From 07180d073bec69cd48895d61f8f9d695c5495318 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Thu, 6 Apr 2023 23:02:07 -0700 Subject: [PATCH] menu opts --- packages/client/src/store.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index d2350e2ed..15cb69ff0 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -1,6 +1,7 @@ import { markRaw, ref } from "vue"; import { Storage } from "./pizzax"; import { Theme } from "./scripts/theme"; +import { deviceKind } from '@/scripts/device-kind'; export const postFormActions = []; export const userActions = []; @@ -8,6 +9,18 @@ export const noteActions = []; export const noteViewInterruptors = []; export const notePostInterruptors = []; +const menuOptions = [ + "notifications", + "followRequests", + "messaging", + "explore", + "favorites", + "channels", + "search" +]; + +if (deviceKind === 'desktop') menuOptions.push("ui"); + // TODO: それぞれいちいちwhereとかdefaultというキーを付けなきゃいけないの冗長なのでなんとかする(ただ型定義が面倒になりそう) // あと、現行の定義の仕方なら「whereが何であるかに関わらずキー名の重複不可」という制約を付けられるメリットもあるからそのメリットを引き継ぐ方法も考えないといけない export const defaultStore = markRaw( @@ -82,17 +95,7 @@ export const defaultStore = markRaw( }, menu: { where: "deviceAccount", - default: [ - "notifications", - undefined, - "followRequests", - "messaging", - "explore", - "favorites", - "channels", - "search", - "ui", - ], + default: menuOptions, }, visibility: { where: "deviceAccount",