feat: Remove getWorkspaceTheme() method

The `getWorkspaceTheme()` method has been removed because it is no longer necessary. The theme information is now retrieved directly from the workspace data in `getWorkspaces()`. This change simplifies the code and improves efficiency.
This commit is contained in:
Kristijan Ribarić 2024-10-26 18:45:17 +02:00
parent ceefcbecef
commit 4b3e8943f4

View file

@ -167,6 +167,13 @@ var ZenWorkspacesStorage = {
default: !!row.getResultByName('is_default'),
containerTabId: row.getResultByName('container_id'),
position: row.getResultByName('position'),
theme: row.getResultByName('theme_type') ? {
type: row.getResultByName('theme_type'),
gradientColors: JSON.parse(row.getResultByName('theme_colors')),
opacity: row.getResultByName('theme_opacity'),
rotation: row.getResultByName('theme_rotation'),
texture: row.getResultByName('theme_texture')
} : null
}));
},
@ -290,32 +297,6 @@ var ZenWorkspacesStorage = {
});
},
async getWorkspaceTheme(uuid) {
const db = await PlacesUtils.promiseDBConnection();
const result = await db.executeCached(`
SELECT
theme_type,
theme_colors,
theme_opacity,
theme_rotation,
theme_texture
FROM zen_workspaces
WHERE uuid = :uuid
`, { uuid });
if (!result.length || !result[0].getResultByName('theme_type')) {
return null;
}
return {
type: result[0].getResultByName('theme_type'),
gradientColors: JSON.parse(result[0].getResultByName('theme_colors')),
opacity: result[0].getResultByName('theme_opacity'),
rotation: result[0].getResultByName('theme_rotation'),
texture: result[0].getResultByName('theme_texture')
};
},
async getChangedIDs() {
const db = await PlacesUtils.promiseDBConnection();
const rows = await db.execute(`