fix(theming): Adjust app order settings for backend changes

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2023-11-08 14:15:58 +01:00
parent 8d0c7cc5fa
commit 0254b68a1a
No known key found for this signature in database
GPG key ID: 45FAE7268762B400
2 changed files with 5 additions and 8 deletions

View file

@ -37,8 +37,7 @@ export interface IApp {
icon: string // path to the icon svg
label: string // display name
default?: boolean // force app as default app
app: string
key: number
app?: string
}
export default defineComponent({

View file

@ -58,13 +58,11 @@ interface INavigationEntry {
/** Whether this is the default app */
default?: boolean
/** App that registered this navigation entry (not necessarly the same as the id) */
app: string
/** The key used to identify this entry in the navigations entries */
key: number
app?: string
}
/** The app order user setting */
type IAppOrder = Record<string, Record<number, number>>
type IAppOrder = Record<string, { order: number, app?: string }>
/** OCS responses */
interface IOCSResponse<T> {
@ -131,8 +129,8 @@ export default defineComponent({
*/
const updateAppOrder = (value: IApp[]) => {
const order: IAppOrder = {}
value.forEach(({ app, key }, index) => {
order[app] = { ...order[app], [key]: index }
value.forEach(({ app, id }, index) => {
order[id] = { order: index, app }
})
saveSetting('apporder', order)