Hide edit context menu entry on <2 servers

This commit is contained in:
Corbin Davenport 2023-02-24 12:41:21 -05:00
parent 7ee4429230
commit 88032c4e4e
1 changed files with 13 additions and 11 deletions

View File

@ -91,7 +91,8 @@ async function createContextMenu() {
contexts: ['selection', 'link', 'page']
})
}
// Add seperator and link to settings
// Add seperator and link to settings, but only if there's more than one server saved
if (data.serverList.length > 1) {
chrome.contextMenus.create({
id: 'none',
type: 'separator',
@ -99,10 +100,11 @@ async function createContextMenu() {
})
chrome.contextMenus.create({
id: 'edit-servers',
title: 'Edit server list',
title: 'Edit server list...',
contexts: ['selection', 'link', 'page']
})
}
}
}
// Function for handling context menu clicks