mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-16 06:46:12 +00:00
Fix: Update pinned tab title in storage on rename
This commit addresses an issue where renaming a pinned tab wouldn't update the title stored in `ZenPinnedTabsStorage`. The following changes were made: - Modified `ZenUIManager.mjs` to asynchronously call `ZenPinnedTabsStorage.updatePinTitle` when a tab is renamed via the keyboard. This ensures the stored title is synchronized with the displayed title. - Added the `updatePinTitle` function to `ZenPinnedTabsStorage.mjs`. This function updates the title of a zen pin within the database. This ensures consistency between the tab title displayed in the UI and the title stored for pinned tabs.
This commit is contained in:
@@ -665,7 +665,7 @@ var gZenVerticalTabsManager = {
|
||||
target.appendChild(child);
|
||||
},
|
||||
|
||||
renameTabKeydown(event) {
|
||||
async renameTabKeydown(event) {
|
||||
if (event.key === 'Enter') {
|
||||
let label = this._tabEdited.querySelector('.tab-label-container-editing');
|
||||
let input = this._tabEdited.querySelector('#tab-label-input');
|
||||
@@ -681,6 +681,11 @@ var gZenVerticalTabsManager = {
|
||||
} else {
|
||||
gBrowser.setTabTitle(this._tabEdited);
|
||||
}
|
||||
const pinId = this._tabEdited.getAttribute('zen-pin-id');
|
||||
if (pinId) {
|
||||
// Update pin title in storage
|
||||
await ZenPinnedTabsStorage.updatePinTitle(pinId, this._tabEdited.label);
|
||||
}
|
||||
|
||||
// Maybe add some confetti here?!?
|
||||
gZenUIManager.motion.animate(
|
||||
|
Reference in New Issue
Block a user