Update migrate.ts (#1000)

This commit is contained in:
Steve Ruiz 2022-09-30 15:28:55 +01:00 committed by GitHub
parent e58599b290
commit e722fcdb4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,8 +51,7 @@ export function migrate(state: TDSnapshot, newVersion: number): TDSnapshot {
} }
}) })
if (version === newVersion) return state if (version !== newVersion) {
if (version < 14) { if (version < 14) {
Object.values(document.pages).forEach((page) => { Object.values(document.pages).forEach((page) => {
Object.values(page.shapes) Object.values(page.shapes)
@ -130,6 +129,7 @@ export function migrate(state: TDSnapshot, newVersion: number): TDSnapshot {
if (version < 15.5) { if (version < 15.5) {
settings.exportBackground = TDExportBackground.Transparent settings.exportBackground = TDExportBackground.Transparent
} }
}
// Cleanup // Cleanup
Object.values(document.pageStates).forEach((pageState) => { Object.values(document.pageStates).forEach((pageState) => {