Migrate viewManager to singleton (#2656)
This commit is contained in:
@@ -31,6 +31,7 @@ import {DOWNLOADS_DROPDOWN_AUTOCLOSE_TIMEOUT, DOWNLOADS_DROPDOWN_MAX_ITEMS} from
|
||||
import * as Validator from 'common/Validator';
|
||||
import {localizeMessage} from 'main/i18nManager';
|
||||
import {displayDownloadCompleted} from 'main/notifications';
|
||||
import ViewManager from 'main/views/viewManager';
|
||||
import WindowManager from 'main/windows/windowManager';
|
||||
import {doubleSecToMs, getPercentage, isStringWithLength, readFilenameFromContentDispositionHeader, shouldIncrementFilename} from 'main/utils';
|
||||
|
||||
@@ -509,7 +510,7 @@ export class DownloadsManager extends JsonFileManager<DownloadedItems> {
|
||||
log.debug('doneEventController', {state});
|
||||
|
||||
if (state === 'completed' && !this.open) {
|
||||
displayDownloadCompleted(path.basename(item.savePath), item.savePath, WindowManager.getServerNameByWebContentsId(webContents.id) || '');
|
||||
displayDownloadCompleted(path.basename(item.savePath), item.savePath, ViewManager.getViewByWebContentsId(webContents.id)?.tab.server.name ?? '');
|
||||
}
|
||||
|
||||
const bookmark = this.bookmarks.get(this.getFileId(item));
|
||||
|
Reference in New Issue
Block a user