diff --git a/frontend/src/ts/commandline/lists/custom-background.ts b/frontend/src/ts/commandline/lists/custom-background.ts index 3033920f415e..a2f64dd20b9c 100644 --- a/frontend/src/ts/commandline/lists/custom-background.ts +++ b/frontend/src/ts/commandline/lists/custom-background.ts @@ -4,6 +4,7 @@ import FileStorage from "../../utils/file-storage"; import { applyCustomBackground } from "../../controllers/theme-controller"; import { updateUI } from "../../elements/settings/custom-background-picker"; import { showNoticeNotification } from "../../stores/notifications"; +import Config, { setConfig } from "../../config"; const fromMeta = buildCommandForConfigKey("customBackground"); @@ -69,16 +70,19 @@ const customBackgroundCommand: Command = { }, }, { - id: "removeLocalBackground", - display: "Remove local background", + id: "removeCustomBackground", + display: "Remove custom background", icon: "fa-trash", - alias: "remove background", available: async (): Promise => { - return await FileStorage.hasFile("LocalBackgroundFile"); + return ( + (await FileStorage.hasFile("LocalBackgroundFile")) || + Config.customBackground !== "" + ); }, exec: async (): Promise => { try { await FileStorage.deleteFile("LocalBackgroundFile"); + setConfig("customBackground", ""); await applyCustomBackground(); await updateUI(); } catch (e) {