From 0158b6fc1bbdd14b0aee8b399fedb21fe80af6ac Mon Sep 17 00:00:00 2001
From: Mar0xy <marie@kaifa.ch>
Date: Sun, 3 Dec 2023 19:59:01 +0100
Subject: [PATCH] fix: Drive folder button not working

Closes #199
---
 packages/frontend/src/components/form/link.vue   | 13 +++++++++++--
 packages/frontend/src/pages/settings/general.vue |  2 ++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/packages/frontend/src/components/form/link.vue b/packages/frontend/src/components/form/link.vue
index 67fc87e37..94ec9a0ba 100644
--- a/packages/frontend/src/components/form/link.vue
+++ b/packages/frontend/src/components/form/link.vue
@@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 			<i class="ph-arrow-square-out ph-bold ph-lg"></i>
 		</span>
 	</a>
-	<MkA v-else :class="[$style.main, { [$style.active]: active }]" class="_button" :to="to" :behavior="behavior">
+	<MkA v-else-if="to" :class="[$style.main, { [$style.active]: active }]" class="_button" :to="to" :behavior="behavior">
 		<span :class="$style.icon"><slot name="icon"></slot></span>
 		<span :class="$style.text"><slot></slot></span>
 		<span :class="$style.suffix">
@@ -21,6 +21,14 @@ SPDX-License-Identifier: AGPL-3.0-only
 			<i class="ph-caret-right ph-bold ph-lg"></i>
 		</span>
 	</MkA>
+	<a v-else-if="onClick" :class="[$style.main, { [$style.active]: active }]" class="_button" :behavior="behavior" @click="onClick">
+		<span :class="$style.icon"><slot name="icon"></slot></span>
+		<span :class="$style.text"><slot></slot></span>
+		<span :class="$style.suffix">
+			<span :class="$style.suffixText"><slot name="suffix"></slot></span>
+			<i class="ph-caret-right ph-bold ph-lg"></i>
+		</span>
+	</a>
 </div>
 </template>
 
@@ -28,9 +36,10 @@ SPDX-License-Identifier: AGPL-3.0-only
 import { } from 'vue';
 
 const props = defineProps<{
-	to: string;
+	to?: string;
 	active?: boolean;
 	external?: boolean;
+	onClick?: () => void;
 	behavior?: null | 'window' | 'browser';
 	inline?: boolean;
 }>();
diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue
index 5e9be51fa..1acdf6f69 100644
--- a/packages/frontend/src/pages/settings/general.vue
+++ b/packages/frontend/src/pages/settings/general.vue
@@ -49,6 +49,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 				<MkSwitch v-model="collapseFiles">{{ i18n.ts.collapseFiles }}</MkSwitch>
 				<MkSwitch v-model="uncollapseCW">Uncollapse CWs on notes</MkSwitch>
 				<MkSwitch v-model="autoloadConversation">{{ i18n.ts.autoloadConversation }}</MkSwitch>
+				<MkSwitch v-model="expandLongNote">Always expand long notes</MkSwitch>
 				<MkSwitch v-model="advancedMfm">{{ i18n.ts.enableAdvancedMfm }}</MkSwitch>
 				<MkSwitch v-if="advancedMfm" v-model="animatedMfm">{{ i18n.ts.enableAnimatedMfm }}</MkSwitch>
 				<MkSwitch v-model="showGapBetweenNotesInTimeline">{{ i18n.ts.showGapBetweenNotesInTimeline }}</MkSwitch>
@@ -281,6 +282,7 @@ const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroup
 const showTickerOnReplies = computed(defaultStore.makeGetterSetter('showTickerOnReplies'));
 const noteDesign = computed(defaultStore.makeGetterSetter('noteDesign'));
 const uncollapseCW = computed(defaultStore.makeGetterSetter('uncollapseCW'));
+const expandLongNote = computed(defaultStore.makeGetterSetter('expandLongNote'));
 
 watch(lang, () => {
 	miLocalStorage.setItem('lang', lang.value as string);