Apply suggestions from code review

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Philipp 2022-11-26 23:34:16 +01:00 committed by Philipp
parent e60dfef0d0
commit 3607aa32ca
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
5 changed files with 9 additions and 10 deletions

View file

@ -60,11 +60,11 @@ const FileBrowser = {
init: function (nickname, type) {
FileBrowser.nickname = nickname;
FileBrowser.type = type;
FileBrowser.event = "fbrowser." + type;
if (location['hash'] !== "") {
FileBrowser.event = 'fbrowser.' + type;
if (location['hash'] !== '') {
const h = location['hash'].replace('#', '');
FileBrowser.event = FileBrowser.event + "." + h.split("-")[0];
FileBrowser.id = h.split("-")[1];
FileBrowser.event = FileBrowser.event + '.' + h.split('-')[0];
FileBrowser.id = h.split('-')[1];
}
console.log('FileBrowser:', nickname, type, FileBrowser.event, FileBrowser.id);