From 79298a406900e4dc13ebbfeeec4acadbf4875c37 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 21 Nov 2022 21:27:39 -0800 Subject: [PATCH] bruh --- package.json | 2 +- packages/client/src/pages/page.vue | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index e336440cb..188fa0ed1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.16.12", + "version": "12.119.0-calc.16.13", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/page.vue b/packages/client/src/pages/page.vue index 73ccd882f..0557cbd42 100644 --- a/packages/client/src/pages/page.vue +++ b/packages/client/src/pages/page.vue @@ -5,7 +5,7 @@
@@ -87,9 +87,8 @@ const props = defineProps<{ username: string; }>(); -let bgImg = 'linear-gradient(to bottom right, #31748f, #9ccfd8)'; - let page = $ref(null); +let bgImg = $ref(null); let error = $ref(null); const otherPostsPagination = { endpoint: 'users/pages' as const, @@ -107,15 +106,18 @@ function fetchPage() { username: props.username, }).then(_page => { page = _page; - getBgImg(); + bgImg = getBgImg(); }).catch(err => { error = err; }); } -function getBgImg() { +function getBgImg(): string { if (page.eyeCatchingImage != null) { - bgImg = `url(${page.eyeCatchingImage.url})`; + return `url(${page.eyeCatchingImage.url})`; + } + else { + return 'linear-gradient(to bottom right, #31748f, #9ccfd8)' } } @@ -163,7 +165,6 @@ function pin(pin) { } watch(() => path, fetchPage, { immediate: true }); -watch(() => bgImg, getBgImg, {}); const headerActions = $computed(() => []);