Rename OpenDefault to AutoOpen
This commit is contained in:
parent
1179db5ad9
commit
ff2d315502
2 changed files with 7 additions and 8 deletions
|
@ -15,9 +15,8 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import {ViewModel} from "../utils/ViewModel.js";
|
||||
import {getMatchingPlatforms, selectPlatforms} from "./clients/index.js";
|
||||
|
||||
export class OpenDefaultViewModel extends ViewModel {
|
||||
export class AutoOpenViewModel extends ViewModel {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
const {client, link, openLinkVM, proposedPlatform, webPlatform} = options;
|
||||
|
@ -50,7 +49,7 @@ export class OpenDefaultViewModel extends ViewModel {
|
|||
}
|
||||
|
||||
close() {
|
||||
this._openLinkVM.closeDefault();
|
||||
this._openLinkVM.closeAutoOpen();
|
||||
}
|
||||
|
||||
tryOpenLink() {
|
|
@ -18,7 +18,7 @@ import {ViewModel} from "../utils/ViewModel.js";
|
|||
import {ClientListViewModel} from "./ClientListViewModel.js";
|
||||
import {ClientViewModel} from "./ClientViewModel.js";
|
||||
import {PreviewViewModel} from "../preview/PreviewViewModel.js";
|
||||
import {OpenDefaultViewModel} from "./OpenDefaultViewModel.js";
|
||||
import {AutoOpenViewModel} from "./AutoOpenViewModel.js";
|
||||
import {ServerConsentViewModel} from "./ServerConsentViewModel.js";
|
||||
import {getLabelForLinkKind} from "../Link.js";
|
||||
import {orderedUnique} from "../utils/unique.js";
|
||||
|
@ -36,12 +36,12 @@ export class OpenLinkViewModel extends ViewModel {
|
|||
this.clientsViewModel = null;
|
||||
this.previewLoading = false;
|
||||
this.tryingLink = false;
|
||||
if (!this._tryOpenDefault()) {
|
||||
if (!this._tryAutoOpen()) {
|
||||
this._activeOpen();
|
||||
}
|
||||
}
|
||||
|
||||
_tryOpenDefault() {
|
||||
_tryAutoOpen() {
|
||||
const client = this._getPreferredClient();
|
||||
let proposedPlatform = null;
|
||||
let webPlatform = null;
|
||||
|
@ -60,7 +60,7 @@ export class OpenLinkViewModel extends ViewModel {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
this.openDefaultViewModel = new OpenDefaultViewModel(this.childOptions({
|
||||
this.openDefaultViewModel = new AutoOpenViewModel(this.childOptions({
|
||||
client,
|
||||
link: this._link,
|
||||
openLinkVM: this,
|
||||
|
@ -71,7 +71,7 @@ export class OpenLinkViewModel extends ViewModel {
|
|||
return true;
|
||||
}
|
||||
|
||||
closeDefault() {
|
||||
closeAutoOpen() {
|
||||
this.openDefaultViewModel = null;
|
||||
// If no client was selected, this is a no-op.
|
||||
// Otherwise, see ClientViewModel.back for some reasons
|
||||
|
|
Loading…
Reference in a new issue