Open
Description
Original source code:
LINK
chrome.storage.local.get('todos', (obj) => {
let todos = obj.todos;
if (todos) {
todos = JSON.parse(todos);
const len = todos.filter(todo => !todo.marked).length;
if (len > 0) {
chrome.browserAction.setBadgeText({ text: len.toString() });
}
} else {
// Initial
chrome.browserAction.setBadgeText({ text: '1' });
}
});
to
chrome.storage.local.get('state', (obj) => {
const state = JSON.parse(obj.state);
const todos = state.todos;
if (todos) {
const len = todos.filter(todo => !todo.marked).length;
if (len > 0) {
chrome.browserAction.setBadgeText({ text: len.toString() });
}
} else {
// Initial
chrome.browserAction.setBadgeText({ text: '1' });
}
});
Metadata
Metadata
Assignees
Labels
No labels