Skip to content

Commit

Permalink
Merge pull request #4138 from alfonso-salces/MOBILE-4581
Browse files Browse the repository at this point in the history
MOBILE-4581 utils: Add lang to openInBrowser urls
  • Loading branch information
dpalou authored Aug 14, 2024
2 parents 81e9018 + 4c55072 commit 071eee2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/core/services/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { InAppBrowserObject, InAppBrowserOptions } from '@awesome-cordova-plugin
import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
import { CoreEvents } from '@singletons/events';
import { CoreFile } from '@services/file';
import { CoreLang } from '@services/lang';
import { CoreLang, CoreLangFormat } from '@services/lang';
import { CoreWS } from '@services/ws';
import { CoreMimetypeUtils } from '@services/utils/mimetype';
import { CoreTextUtils } from '@services/utils/text';
Expand Down Expand Up @@ -1173,12 +1173,14 @@ export class CoreUtilsProvider {
}
}

CoreAnalytics.logEvent({
type: CoreAnalyticsEventType.OPEN_LINK,
link: originaUrl,
});

window.open(url, '_system');
const site = CoreSites.getCurrentSite();
CoreAnalytics.logEvent({ type: CoreAnalyticsEventType.OPEN_LINK, link: originaUrl });
window.open(
site?.containsUrl(url)
? CoreUrl.addParamsToUrl(url, { lang: await CoreLang.getCurrentLanguage(CoreLangFormat.LMS) })
: url,
'_system',
);
}

/**
Expand Down

0 comments on commit 071eee2

Please sign in to comment.