File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { app } from 'electron'
12import * as db from '../index'
23
34class Settings {
@@ -57,6 +58,19 @@ class Settings {
5758 await db . settings . removeAsync ( { _id : 'screenshotAskPath' } )
5859 }
5960
61+ // In FreeTube 0.24.1 and earlier, the 'Minimize to system tray' setting could be enabled on Wayland despite lacking support.
62+ // The setting is now hidden from Wayland users.
63+ // This migration disables the setting for existing users who had it enabled.
64+ // This prevents users from being stuck with an enabled setting they can no longer change
65+ // if Wayland gains 'minimize' state support in the future.
66+ // Note: This will have to be removed if support is added back in the future
67+ const hideToTrayOnMinimize = await db . settings . findOneAsync ( { _id : 'hideToTrayOnMinimize' } )
68+
69+ if ( hideToTrayOnMinimize && hideToTrayOnMinimize . value &&
70+ process . platform === 'linux' && app . commandLine . getSwitchValue ( 'ozone-platform' ) === 'wayland' ) {
71+ await this . upsert ( 'hideToTrayOnMinimize' , false )
72+ }
73+
6074 return db . settings . findAsync ( { _id : { $ne : 'bounds' } } )
6175 }
6276
You can’t perform that action at this time.
0 commit comments