diff --git a/src/presentation/components/Scripts/Menu/TheOsChanger.vue b/src/presentation/components/Scripts/Menu/TheOsChanger.vue index 6bebcacbb..e0cf643a4 100644 --- a/src/presentation/components/Scripts/Menu/TheOsChanger.vue +++ b/src/presentation/components/Scripts/Menu/TheOsChanger.vue @@ -14,10 +14,11 @@ import { defineComponent, computed } from 'vue'; import { injectKey } from '@/presentation/injectionSymbols'; import { OperatingSystem } from '@/domain/OperatingSystem'; +import { getOperatingSystemDisplayName } from '@/presentation/components/Shared/OperatingSystemNames'; import MenuOptionList from './MenuOptionList.vue'; import MenuOptionListItem from './MenuOptionListItem.vue'; -interface IOsViewModel { +interface OperatingSystemOption { readonly name: string; readonly os: OperatingSystem; } @@ -31,12 +32,12 @@ export default defineComponent({ const { modifyCurrentContext, currentState } = injectKey((keys) => keys.useCollectionState); const { application } = injectKey((keys) => keys.useApplication); - const allOses = computed>( + const allOses = computed>( () => application .getSupportedOsList() - .map((os) : IOsViewModel => ({ + .map((os) : OperatingSystemOption => ({ os, - name: renderOsName(os), + name: getOperatingSystemDisplayName(os), })), ); @@ -57,13 +58,4 @@ export default defineComponent({ }; }, }); - -function renderOsName(os: OperatingSystem): string { - switch (os) { - case OperatingSystem.Windows: return 'Windows'; - case OperatingSystem.macOS: return 'macOS'; - case OperatingSystem.Linux: return 'Linux (preview)'; - default: throw new RangeError(`Cannot render os name: ${OperatingSystem[os]}`); - } -} diff --git a/src/presentation/components/Scripts/View/Tree/ScriptsTree.vue b/src/presentation/components/Scripts/View/Tree/ScriptsTree.vue index 8bf044be6..7cc1b6479 100644 --- a/src/presentation/components/Scripts/View/Tree/ScriptsTree.vue +++ b/src/presentation/components/Scripts/View/Tree/ScriptsTree.vue @@ -5,9 +5,9 @@ 'top-padding': hasTopPadding, }" > -