(core) Fix for the creator panel on custom section.

Summary: Stop opening the creator panel on chart or custom widgets. Only switch tabs when panel is open

Test Plan: Updated

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3868
This commit is contained in:
Jarosław Sadziński
2023-04-18 13:43:29 +02:00
parent f490854324
commit 69fea132de
2 changed files with 9 additions and 11 deletions

View File

@@ -518,17 +518,8 @@ export class GristDoc extends DisposableWithEvents {
// panel to the table.
this.autoDispose(this.viewModel.activeSection.subscribe((section) => {
if (section.isDisposed() || section._isDeleted.peek()) { return; }
if ('chart' === section.parentKey.peek()) {
if (['chart', 'custom'].includes(section.parentKey.peek())) {
commands.allCommands.viewTabFocus.run();
} else if ('custom' === section.parentKey.peek()) {
// Check if user has seen custom URL tooltip.
const seenTooltip = this.behavioralPromptsManager.hasSeenTip('customURL');
// If yes, just focus on the table if it is opened
if (seenTooltip) {
commands.allCommands.viewTabFocus.run();
} else {
commands.allCommands.viewTabOpen.run();
}
}
}));
}