This commit is contained in:
Jarek Radosz 2022-08-14 22:38:04 +02:00
parent 20299450c7
commit b29dc2971c
No known key found for this signature in database
GPG Key ID: 62D0FBAE5BF9B953
2 changed files with 6 additions and 5 deletions

View File

@ -2,12 +2,12 @@ import { getOwner } from "discourse-common/lib/get-owner";
import deprecated from "discourse-common/lib/deprecated";
deprecated(
"`discourse/lib/mobile` import is deprecated. Use `isMobileDevice`, `mobileView`, properties and `toggleMobileView` method on `site:service`."
"`discourse/lib/mobile` import is deprecated. Use `isMobileDevice`, `mobileView`, properties and `toggleMobileView` method on `service:site`."
);
function site() {
// Use the "default owner"
return getOwner().lookup("site:service");
return getOwner().lookup("service:site");
}
const Mobile = {

View File

@ -308,12 +308,13 @@ export function acceptance(name, optionsOrCallback) {
}
this.siteSettings = currentSettings();
resetSite(currentSettings(), siteChanges);
if (mobileView) {
Site.current().mobileView = true;
siteChanges ||= {};
siteChanges.mobileView = true;
}
resetSite(currentSettings(), siteChanges);
this.container = getOwner(this);
if (!this.owner) {