Add "Android app settings" button

This commit is contained in:
redphx 2024-05-15 17:46:36 +07:00
parent fcaab4ce77
commit 07b477a738

View File

@ -148,8 +148,20 @@ export function setupSettingsUi() {
$updateAvailable.classList.remove('bx-gone');
}
if (AppInterface) {
// Show Android app settings button
const $btn = createButton({
label: t('android-app-settings'),
icon: BxIcon.STREAM_SETTINGS,
style: ButtonStyle.FULL_WIDTH | ButtonStyle.FOCUSABLE,
onClick: e => {
AppInterface.openAppSettings && AppInterface.openAppSettings();
},
});
$wrapper.appendChild($btn);
} else {
// Show link to Android app
if (!AppInterface) {
const userAgent = UserAgent.getDefault().toLowerCase();
if (userAgent.includes('android')) {
const $btn = createButton({