client: Hide tray settings on web

This commit is contained in:
Elian Doran 2024-08-16 22:05:53 +03:00
parent 4a8c3d719f
commit 1172908e41
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

View File

@ -6,3 +6,8 @@ test("Native Title Bar not displayed on web", async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Native Title Bar (requires' })).toBeHidden();
});
test("Tray settings not displayed on web", async ({ page }) => {
await page.goto('http://localhost:8082/#root/_hidden/_options/_optionsOther');
await expect(page.getByRole('heading', { name: 'Note Erasure Timeout' })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Tray' })).toBeHidden();
});

View File

@ -1,5 +1,6 @@
import OptionsWidget from "../options_widget.js";
import { t } from "../../../../services/i18n.js";
import utils from "../../../../services/utils.js";
const TPL = `
<div class="options-section">
@ -19,6 +20,10 @@ export default class TrayOptions extends OptionsWidget {
this.updateOption('disableTray', !this.$trayEnabled.is(":checked") ? "true" : "false"));
}
isEnabled() {
return utils.isElectron();
}
async optionsLoaded(options) {
this.$trayEnabled.prop("checked", options.disableTray !== 'true');
}