add method to get preferred web instance out of link

this is a preference that can be put in the link
This commit is contained in:
Bruno Windels 2021-02-04 17:05:18 +01:00
parent 82f16b9231
commit 28fb6dfe9d
6 changed files with 15 additions and 0 deletions

View File

@ -88,4 +88,9 @@ export class Element {
canInterceptMatrixToLinks(platform) { canInterceptMatrixToLinks(platform) {
return platform === Platform.Android; return platform === Platform.Android;
} }
getPreferredWebInstance(link) {
const idx = trustedWebInstances.indexOf(link.webInstances[this.id])
return idx === -1 ? undefined : trustedWebInstances[idx];
}
} }

View File

@ -48,4 +48,6 @@ export class Fractal {
return [new FlathubLink("org.gnome.Fractal")]; return [new FlathubLink("org.gnome.Fractal")];
} }
} }
getPreferredWebInstance(link) {}
} }

View File

@ -50,4 +50,6 @@ export class Nheko {
return [new FlathubLink("io.github.NhekoReborn.Nheko")]; return [new FlathubLink("io.github.NhekoReborn.Nheko")];
} }
} }
getPreferredWebInstance(link) {}
} }

View File

@ -47,4 +47,6 @@ export class Quaternion {
return [new FlathubLink("com.github.quaternion")]; return [new FlathubLink("com.github.quaternion")];
} }
} }
getPreferredWebInstance(link) {}
} }

View File

@ -47,4 +47,6 @@ export class Tensor {
return [new FDroidLink("io.davidar.tensor")]; return [new FDroidLink("io.davidar.tensor")];
} }
} }
getPreferredWebInstance(link) {}
} }

View File

@ -46,4 +46,6 @@ export class Weechat {
} }
getInstallLinks(platform) {} getInstallLinks(platform) {}
getPreferredWebInstance(link) {}
} }