-
+
@@ -45,7 +45,8 @@ const tlComponent = $shallowRef
>();
const rootEl = $shallowRef();
let queue = $ref(0);
-const src = $computed({ get: () => defaultStore.reactiveState.tl.value.src, set: (x) => saveSrc(x) });
+let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global');
+const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
watch ($$(src), () => queue = 0);
@@ -94,6 +95,7 @@ function saveSrc(newSrc: 'home' | 'local' | 'social' | 'global'): void {
...defaultStore.state.tl,
src: newSrc,
});
+ srcWhenNotSignin = newSrc;
}
async function timetravel(): Promise {
@@ -148,6 +150,21 @@ const headerTabs = $computed(() => [{
onClick: chooseChannel,
}]);
+const headerTabsWhenNotLogin = $computed(() => [
+ ...(isLocalTimelineAvailable ? [{
+ key: 'local',
+ title: i18n.ts._timelines.local,
+ icon: 'ti ti-planet',
+ iconOnly: true,
+ }] : []),
+ ...(isGlobalTimelineAvailable ? [{
+ key: 'global',
+ title: i18n.ts._timelines.global,
+ icon: 'ti ti-whirl',
+ iconOnly: true,
+ }] : []),
+]);
+
definePageMetadata(computed(() => ({
title: i18n.ts.timeline,
icon: src === 'local' ? 'ti ti-planet' : src === 'social' ? 'ti ti-rocket' : src === 'global' ? 'ti ti-whirl' : 'ti ti-home',
diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue
index c960b3127..56858a937 100644
--- a/packages/frontend/src/pages/user/home.vue
+++ b/packages/frontend/src/pages/user/home.vue
@@ -39,7 +39,10 @@
-
{{ role.name }}
+
+
+ {{ role.name }}
+
diff --git a/packages/frontend/src/plugin.ts b/packages/frontend/src/plugin.ts
index c19fe2b08..17eb99be2 100644
--- a/packages/frontend/src/plugin.ts
+++ b/packages/frontend/src/plugin.ts
@@ -20,7 +20,11 @@ export function install(plugin) {
inputText({
title: q,
}).then(({ canceled, result: a }) => {
- ok(a);
+ if (canceled) {
+ ok('');
+ } else {
+ ok(a);
+ }
});
});
},
diff --git a/packages/frontend/src/router.ts b/packages/frontend/src/router.ts
index 595b1f622..87d42c5c8 100644
--- a/packages/frontend/src/router.ts
+++ b/packages/frontend/src/router.ts
@@ -484,6 +484,9 @@ export const routes = [{
path: '/clicker',
component: page(() => import('./pages/clicker.vue')),
loginRequired: true,
+}, {
+ path: '/timeline',
+ component: page(() => import('./pages/timeline.vue')),
}, {
name: 'index',
path: '/',
diff --git a/packages/frontend/src/scripts/aiscript/api.ts b/packages/frontend/src/scripts/aiscript/api.ts
index 12f00bd32..1b47eaa42 100644
--- a/packages/frontend/src/scripts/aiscript/api.ts
+++ b/packages/frontend/src/scripts/aiscript/api.ts
@@ -27,7 +27,11 @@ export function createAiScriptEnv(opts) {
return confirm.canceled ? values.FALSE : values.TRUE;
}),
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
- if (token) utils.assertString(token);
+ if (token) {
+ utils.assertString(token);
+ // バグがあればundefinedもあり得るため念のため
+ if (typeof token.value !== 'string') throw new Error('invalid token');
+ }
apiRequests++;
if (apiRequests > 16) return values.NULL;
const res = await os.api(ep.value, utils.valToJs(param), token ? token.value : (opts.token ?? null));
diff --git a/packages/frontend/src/ui/visitor.vue b/packages/frontend/src/ui/visitor.vue
index ec9150d34..797e2aa6c 100644
--- a/packages/frontend/src/ui/visitor.vue
+++ b/packages/frontend/src/ui/visitor.vue
@@ -5,14 +5,14 @@