MOBILE-3320 core: Fix localhost images in browser
parent
f1f3953749
commit
2b97944510
|
@ -29,6 +29,7 @@ import { Platform } from '@singletons';
|
|||
|
||||
import { mock, mockSingleton, RenderConfig, renderWrapperComponent } from '@/testing/utils';
|
||||
import { CoreFilter } from '@features/filter/services/filter';
|
||||
import { CoreApp } from '@services/app';
|
||||
|
||||
describe('CoreFormatTextDirective', () => {
|
||||
|
||||
|
@ -87,6 +88,7 @@ describe('CoreFormatTextDirective', () => {
|
|||
getCurrentSite: () => Promise.resolve(site),
|
||||
});
|
||||
mockSingleton(CoreFilter, { formatText: (text) => Promise.resolve(text) });
|
||||
mockSingleton(CoreApp, { isMobile: () => false });
|
||||
|
||||
// Act
|
||||
const fixture = await renderWrapperComponent(
|
||||
|
|
|
@ -19,6 +19,7 @@ import { CoreTextUtils } from '@services/utils/text';
|
|||
import { CoreConstants } from '@/core/constants';
|
||||
import { makeSingleton } from '@singletons';
|
||||
import { CoreUrl } from '@singletons/url';
|
||||
import { CoreApp } from '@services/app';
|
||||
|
||||
/*
|
||||
* "Utils" service with helper functions for URLs.
|
||||
|
@ -443,7 +444,7 @@ export class CoreUrlUtilsProvider {
|
|||
scheme == 'file' ||
|
||||
scheme == 'filesystem' ||
|
||||
scheme == CoreConstants.CONFIG.ioswebviewscheme ||
|
||||
(scheme === 'http' && domain === 'localhost');
|
||||
(CoreApp.isMobile() && scheme === 'http' && domain === 'localhost'); // @todo: Get served domain from ENV.
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue