Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FP-2539: Reset bookmarks when we change active tab #186

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 1.0.0 --installs on--> 2.4 IDE-EE / 3.1 IDE-CE

- [FP-2539 - Reset bookmarks when we change active tab](https://movai.atlassian.net/browse/FP-2539)
- [FP-2527 - Preventing the reload of a new doc when it's closed](https://movai.atlassian.net/browse/FP-2527)
- [FP-2216 - IDE- black screen after changing resolution](https://movai.atlassian.net/browse/FP-2216)
- [FP-2542 - Removed code that prevented flow validations from running](https://movai.atlassian.net/browse/FP-2542)
Expand Down
18 changes: 16 additions & 2 deletions src/engine/ReactPlugin/EditorReactPlugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { forwardRef, useCallback, useEffect, useRef } from "react";
import { Utils } from "@mov-ai/mov-fe-lib-core";
import PluginManagerIDE from "../PluginManagerIDE/PluginManagerIDE";
import withAlerts from "../../decorators/withAlerts";
import withKeyBinds from "../../decorators/withKeyBinds";
import withMenuHandler from "../../decorators/withMenuHandler";
Expand Down Expand Up @@ -76,7 +77,7 @@ export function withEditorPlugin(ReactComponent, methods = []) {
if (data.id !== id || instance?.id !== Utils.getNameFromURL(id))
deactivateEditor();
},
[id, activateEditor]
[id, deactivateEditor]
);

/**
Expand All @@ -93,6 +94,8 @@ export function withEditorPlugin(ReactComponent, methods = []) {
);

if (validTab && data.id === id) {
// We should reset bookmarks when changing tabs. Right? And Left too :D
PluginManagerIDE.resetBookmarks();
updateRightMenu();
activateEditor();
}
Expand All @@ -110,7 +113,18 @@ export function withEditorPlugin(ReactComponent, methods = []) {
off(PLUGINS.TABS.NAME, PLUGINS.TABS.ON.ACTIVE_TAB_CHANGE);
off(PLUGINS.DOC_MANAGER.NAME, PLUGINS.DOC_MANAGER.ON.UPDATE_DOC_DIRTY);
};
}, [id, addKeyBind, removeKeyBind, on, off, save, activateThisEditor]);
}, [
id,
addKeyBind,
removeKeyBind,
on,
off,
save,
call,
updateRightMenu,
activateThisEditor,
activateEditor
]);

return (
<div
Expand Down
Loading