Skip to content

Commit 9a409df

Browse files
committed
fix(pages): fix page creation on another group
1 parent 7ac0df5 commit 9a409df

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

apps/client/src/code/api-interface/pages/create.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { asyncDialog } from 'src/code/utils/misc';
1313

1414
export async function createPage(input: {
1515
parentPageId: string;
16-
currentGroupId: string;
16+
destGroupId: string;
1717

1818
pageRelativeTitle: string;
1919
pageAbsoluteTitle?: string;
@@ -109,11 +109,9 @@ export async function createPage(input: {
109109
),
110110
};
111111
} else {
112-
groupId = input.currentGroupId;
112+
groupId = input.destGroupId;
113113

114-
groupContentKeyring = await groupContentKeyrings()(
115-
input.currentGroupId,
116-
).getAsync();
114+
groupContentKeyring = await groupContentKeyrings()(groupId).getAsync();
117115

118116
if (groupContentKeyring?.topLayer === DataLayer.Symmetric) {
119117
const destGroupPassword = await asyncDialog<string>({
@@ -132,7 +130,7 @@ export async function createPage(input: {
132130
});
133131

134132
groupContentKeyring = await unlockGroupContentKeyring(
135-
input.currentGroupId,
133+
groupId,
136134
destGroupPassword,
137135
);
138136
}

apps/client/src/layouts/PagesLayout/RightSidebar/NoteProperties/NewPageDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ async function _createPage() {
235235
236236
const response = await createPage({
237237
parentPageId: page.value.id,
238-
currentGroupId: page.value.react.groupId,
238+
destGroupId: page.value.react.groupId,
239239
240240
pageRelativeTitle: pageRelativeTitle.value,
241241

apps/client/src/layouts/PagesLayout/RightSidebar/NoteProperties/NoteProperties.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ function getInitialPageTitle() {
773773
async function createNewPageQuick() {
774774
const response = await createPage({
775775
parentPageId: page.value.id,
776-
currentGroupId: page.value.react.groupId,
776+
destGroupId: page.value.react.groupId,
777777
778778
pageRelativeTitle: getInitialPageTitle(),
779779
});

0 commit comments

Comments
 (0)