add: remove all to avoid error logging

This commit is contained in:
Andrei O 2023-02-28 15:25:00 +02:00
parent def6c6d5f9
commit e4be318ca9
No known key found for this signature in database
GPG Key ID: B961E5B68389457E

View File

@ -42,6 +42,7 @@ const onRightClickLike = async (store, info, tab) => {
const enableRightClickVote = async () => { const enableRightClickVote = async () => {
try { try {
await chrome.contextMenus.removeAll();
await chrome.contextMenus.create({ await chrome.contextMenus.create({
id: "yup-like", id: "yup-like",
title: "Like this page", title: "Like this page",
@ -50,9 +51,6 @@ const enableRightClickVote = async () => {
} catch (error) { } catch (error) {
// ignore // ignore
} }
if(chrome.runtime.lastError) {
console.warn('Error creating context menu', chrome.runtime.lastError.message)
}
} }
const disableRightClickVote = async () => { const disableRightClickVote = async () => {