mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:19:57 +02:00
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:
parent
ceefcbecef
commit
4b3e8943f4
1 changed files with 7 additions and 26 deletions
|
@ -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(`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue