Replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
@@ -26,8 +26,8 @@ import { generateUrl } from '@nextcloud/router'
|
||||
subscribe('calendar:handle-todo-click', ({ calendarId, taskId }) => {
|
||||
const deckAppPrefix = 'app-generated--deck--board-'
|
||||
if (calendarId.startsWith(deckAppPrefix)) {
|
||||
const board = calendarId.substr(deckAppPrefix.length)
|
||||
const card = taskId.substr('card-'.length).replace('.ics', '')
|
||||
const board = calendarId.slice(deckAppPrefix.length)
|
||||
const card = taskId.slice('card-'.length).replace('.ics', '')
|
||||
console.debug('[deck] Clicked task matches deck calendar pattern')
|
||||
window.location = generateUrl(`apps/deck/#/board/${board}/card/${card}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user