patch: fix flashing from URL when using basic auth

This commit is contained in:
Marco Füllemann 2022-02-04 14:28:00 +01:00 committed by flec
parent 03ee428039
commit a6f6cd4a19
2 changed files with 8 additions and 1 deletions

View File

@ -315,6 +315,7 @@ export interface SourceMetadata extends sourceDestination.Metadata {
drive?: DrivelistDrive; drive?: DrivelistDrive;
extension?: string; extension?: string;
archiveExtension?: string; archiveExtension?: string;
auth?: Authentication;
} }
interface SourceSelectorProps { interface SourceSelectorProps {
@ -529,6 +530,7 @@ export class SourceSelector extends React.Component<
} }
if (metadata !== undefined) { if (metadata !== undefined) {
metadata.auth = auth;
selectionState.selectSource(metadata); selectionState.selectSource(metadata);
analytics.logEvent('Select image', { analytics.logEvent('Select image', {
// An easy way so we can quickly identify if we're making use of // An easy way so we can quickly identify if we're making use of

View File

@ -291,9 +291,14 @@ ipc.connectTo(IPC_SERVER_ID, () => {
url: imagePathObject.url, url: imagePathObject.url,
avoidRandomAccess: true, avoidRandomAccess: true,
axiosInstance: axios.create(_.omit(imagePathObject, ['url'])), axiosInstance: axios.create(_.omit(imagePathObject, ['url'])),
auth: options.image.auth,
}); });
} else { } else {
source = new Http({ url: imagePath, avoidRandomAccess: true }); source = new Http({
url: imagePath,
avoidRandomAccess: true,
auth: options.image.auth,
});
} }
} }
} }