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

#9242: migrate unsaved standalone mod components in the Page Editor #9246

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
277 changes: 0 additions & 277 deletions src/pageEditor/hooks/useMigrateStandaloneComponentsToMods.test.ts

This file was deleted.

66 changes: 0 additions & 66 deletions src/pageEditor/hooks/useMigrateStandaloneComponentsToMods.ts

This file was deleted.

6 changes: 2 additions & 4 deletions src/pageEditor/hooks/useRemoveModComponentFromStorage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ export const DEACTIVATE_MOD_MODAL_PROPS: ConfirmationModalProps = {
/**
* Returns a callback that removes a mod component from the Page Editor and Mod Component Storage.
*
* For mod components packaged inside a mod and standalone mod components not saved on the cloud, this callback will effectively delete the mod component.
* For saved standalone mods, this callback will simply deactivate the mod and remove it from the Page Editor.
*
* In both cases, unsaved changes will be lost.
* For mod components packaged inside a mod, this callback will effectively delete the mod component. Any unsaved
* changes will be lost.
*/
export function useRemoveModComponentFromStorage(): (
useRemoveConfig: Config,
Expand Down
10 changes: 0 additions & 10 deletions src/pageEditor/layout/EditorLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { selectIsStaleSession } from "@/store/sessionChanges/sessionChangesSelec
import StaleSessionPane from "@/pageEditor/panes/StaleSessionPane";
import { actions as editorActions } from "@/pageEditor/store/editor/editorSlice";
import { usePreviousValue } from "@/hooks/usePreviousValue";
import useMigrateStandaloneComponentsToMods from "@/pageEditor/hooks/useMigrateStandaloneComponentsToMods";
import { RestrictedFeatures } from "@/auth/featureFlags";

const EditorLayout: React.FunctionComponent = () => {
Expand All @@ -47,15 +46,6 @@ const EditorLayout: React.FunctionComponent = () => {

const url = useCurrentInspectedUrl();

/**
* Migrate form states for activated standalone mod components. We are
* running it here because it's the top-most component underneath
* the redux-persist PersistGate.
*
* @since 2.0.8
*/
useMigrateStandaloneComponentsToMods();

const currentPane = useMemo(
() =>
isRestricted ? (
Expand Down
Loading
Loading