mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-30 08:34:37 +00:00
feat: Add more migration options, b=no-bug, c=no-component
This commit is contained in:
@@ -678,6 +678,7 @@
|
||||
clientX < 0 || clientX > innerWidth || clientY < 0 || clientY > innerHeight;
|
||||
if (isOutOfWindow && !this.#isOutOfWindow) {
|
||||
this.#isOutOfWindow = true;
|
||||
gZenViewSplitter.onBrowserDragEndToSplit(event, true);
|
||||
this.#maybeClearVerticalPinnedGridDragOver();
|
||||
this.clearSpaceSwitchTimer();
|
||||
this.clearDragOverVisuals();
|
||||
@@ -716,20 +717,22 @@
|
||||
const dt = event.dataTransfer;
|
||||
const activeWorkspace = gZenWorkspaces.activeWorkspace;
|
||||
let draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
|
||||
if (
|
||||
isTab(draggedTab) &&
|
||||
!draggedTab.hasAttribute("zen-essential") &&
|
||||
draggedTab.getAttribute("zen-workspace-id") != activeWorkspace
|
||||
) {
|
||||
const movingTabs = draggedTab._dragData?.movingTabs || [draggedTab];
|
||||
for (let tab of movingTabs) {
|
||||
tab.setAttribute("zen-workspace-id", activeWorkspace);
|
||||
if (draggedTab.ownerGlobal === window) {
|
||||
if (
|
||||
isTab(draggedTab) &&
|
||||
!draggedTab.hasAttribute("zen-essential") &&
|
||||
draggedTab.getAttribute("zen-workspace-id") != activeWorkspace
|
||||
) {
|
||||
const movingTabs = draggedTab._dragData?.movingTabs || [draggedTab];
|
||||
for (let tab of movingTabs) {
|
||||
tab.setAttribute("zen-workspace-id", activeWorkspace);
|
||||
}
|
||||
gBrowser.selectedTab = draggedTab;
|
||||
}
|
||||
if (isTabGroupLabel(draggedTab)) {
|
||||
draggedTab = draggedTab.group;
|
||||
gZenFolders.changeFolderToSpace(draggedTab, activeWorkspace, { hasDndSwitch: true });
|
||||
}
|
||||
gBrowser.selectedTab = draggedTab;
|
||||
}
|
||||
if (isTabGroupLabel(draggedTab)) {
|
||||
draggedTab = draggedTab.group;
|
||||
gZenFolders.changeFolderToSpace(draggedTab, activeWorkspace, { hasDndSwitch: true });
|
||||
}
|
||||
gZenWorkspaces.updateTabsContainers();
|
||||
}
|
||||
|
||||
@@ -151,6 +151,19 @@ export class nsZenSessionManager {
|
||||
folderIcon: row.getResultByName("folder_icon"),
|
||||
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
|
||||
}));
|
||||
try {
|
||||
data.recoveryData = await IOUtils.readJSON(
|
||||
PathUtils.join(
|
||||
Services.dirsvc.get("ProfD", Ci.nsIFile).path,
|
||||
"sessionstore-backups",
|
||||
"recovery.jsonlz4"
|
||||
),
|
||||
{ decompress: true }
|
||||
);
|
||||
this.log("Recovered recovery data from sessionstore-backups");
|
||||
} catch {
|
||||
/* ignore errors reading recovery data */
|
||||
}
|
||||
this._migrationData = data;
|
||||
} catch {
|
||||
/* ignore errors during migration */
|
||||
@@ -298,6 +311,11 @@ export class nsZenSessionManager {
|
||||
initialState?.lastSessionState,
|
||||
this._migrationData
|
||||
);
|
||||
if (!initialState?.windows?.length && this._migrationData?.recoveryData) {
|
||||
this.log("Using recovery data for migration");
|
||||
initialState = this._migrationData.recoveryData;
|
||||
}
|
||||
delete this._migrationData?.recoveryData;
|
||||
// Restore spaces into the sidebar object if we don't
|
||||
// have any yet.
|
||||
if (!this.#sidebar.spaces?.length) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"brandShortName": "Zen",
|
||||
"brandFullName": "Zen Browser",
|
||||
"release": {
|
||||
"displayVersion": "1.18.2b",
|
||||
"displayVersion": "1.18.3b",
|
||||
"github": {
|
||||
"repo": "zen-browser/desktop"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user