Skip to content

Commit 510f4bb

Browse files
Merge pull request #270 from codex-team/tabbar-issue
fix(tabbar): issue of tabbar duplicate of note setting fixed
2 parents 258d7b5 + efdcf90 commit 510f4bb

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/application/i18n/messages/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
},
4545
"noteSettings": {
4646
"title": "Note Settings",
47+
"settings": "Settings",
4748
"customHostname": "Custom Hostname",
4849
"hostnamePlaceholder": "example: landing.codex.so",
4950
"availabilityTitle": "Availability",

src/presentation/pages/NoteSettings.vue

+14-1
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,16 @@ import useNoteSettings from '@/application/services/useNoteSettings';
102102
import useNote from '@/application/services/useNote';
103103
import { useHead } from 'unhead';
104104
import { useI18n } from 'vue-i18n';
105-
import { computed, ref, onMounted } from 'vue';
105+
import { computed, ref, onMounted, watch } from 'vue';
106106
import { useDebounceFn } from '@vueuse/core';
107107
import Team from '@/presentation/components/team/Team.vue';
108108
import { Section, Row, Switch, Button, Heading, Fieldset, Input, Card } from 'codex-ui/vue';
109109
import ThreeColsLayout from '@/presentation/layouts/ThreeColsLayout.vue';
110110
import { getTitle } from '@/infrastructure/utils/note';
111111
import { getTimeFromNow } from '@/infrastructure/utils/date';
112112
import InviteLink from '@/presentation/components/noteSettings/InviteLink.vue';
113+
import useHeader from '@/application/services/useHeader';
114+
import { useRoute } from 'vue-router';
113115
114116
const { t } = useI18n();
115117
@@ -120,6 +122,8 @@ const props = defineProps<{
120122
id: NoteId;
121123
}>();
122124
125+
const { patchOpenedPageByUrl } = useHeader();
126+
const route = useRoute();
123127
const { noteSettings, load: loadSettings, updateIsPublic, deleteNoteById, parentNote, setParent } = useNoteSettings();
124128
const { noteTitle, unlinkParent } = useNote({
125129
id: props.id,
@@ -204,6 +208,15 @@ useHead({
204208
title: t('noteSettings.title'),
205209
});
206210
211+
watch(noteTitle, (newTitle) => {
212+
const openPageInfo = {
213+
title: `${t('noteSettings.settings')} (${newTitle})`,
214+
url: route.path,
215+
};
216+
217+
patchOpenedPageByUrl(route.path, openPageInfo);
218+
});
219+
207220
onMounted(async () => {
208221
await loadSettings(props.id);
209222
parentURL.value = getParentURL(parentNote.value?.id);

0 commit comments

Comments
 (0)