Skip to content

Commit

Permalink
Bug fix parsing topic:names:with:TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
tconfrey committed Feb 23, 2024
1 parent 556495f commit ead885c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ async function saveTabs(msg, sender) {
if (t.id == BTTab || t.pinned) return;
const tab = {'tabId': t.id, 'groupId': t.groupId, 'windowId': t.windowId, 'url': t.url,
'favIconUrl': t.faviconUrl, 'tabIndex': t.tabIndex, 'title': t.title};
const tgName = tgNames[t.groupId] || '';
const [topic, todo] = msg.topic.split(':'); // topic might have trailing :TODO or :DONE. split it off
const tgName = tgNames[t.groupId] || ''; // might want tabgroup name as topic
const [topic, todo] = msg.topic.split(/:(TODO|DONE)$/, 2); // entered topic might have trailing :TODO or :DONE. split it off
if (saveType == 'Tab' && t.id == currentTab.id) {
tab['topic'] = topic+(todo ? ':'+todo : '');
tab['title'] = msg.title; // original or popup-edited tab title
Expand Down
4 changes: 2 additions & 2 deletions versions/Release-Candidate/extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ async function saveTabs(msg, sender) {
if (t.id == BTTab || t.pinned) return;
const tab = {'tabId': t.id, 'groupId': t.groupId, 'windowId': t.windowId, 'url': t.url,
'favIconUrl': t.faviconUrl, 'tabIndex': t.tabIndex, 'title': t.title};
const tgName = tgNames[t.groupId] || '';
const [topic, todo] = msg.topic.split(':'); // topic might have trailing :TODO or :DONE. split it off
const tgName = tgNames[t.groupId] || ''; // might want tabgroup name as topic
const [topic, todo] = msg.topic.split(/:(TODO|DONE)$/, 2); // entered topic might have trailing :TODO or :DONE. split it off
if (saveType == 'Tab' && t.id == currentTab.id) {
tab['topic'] = topic+(todo ? ':'+todo : '');
tab['title'] = msg.title; // original or popup-edited tab title
Expand Down

0 comments on commit ead885c

Please sign in to comment.