forked from trent_larson/crowd-funder-for-time-pwa
fix(mixin): access platformService as property, not function, in PlatformServiceMixin
- Fix all computed properties to use platformService as a property - Add descriptive @ts-expect-error comments for dynamic property access - Resolves 'this.platformService is not a function' runtime error - Lint clean
This commit is contained in:
@@ -121,30 +121,26 @@ export const PlatformServiceMixin = {
|
||||
* Platform detection utilities
|
||||
*/
|
||||
isCapacitor(): boolean {
|
||||
return (this as unknown as VueComponentWithMixin)
|
||||
.platformService()
|
||||
.isCapacitor();
|
||||
// @ts-expect-error Accessing computed property value from Vue instance
|
||||
return this["platformService"].isCapacitor();
|
||||
},
|
||||
|
||||
isWeb(): boolean {
|
||||
return (this as unknown as VueComponentWithMixin)
|
||||
.platformService()
|
||||
.isWeb();
|
||||
// @ts-expect-error Accessing computed property value from Vue instance
|
||||
return this["platformService"].isWeb();
|
||||
},
|
||||
|
||||
isElectron(): boolean {
|
||||
return (this as unknown as VueComponentWithMixin)
|
||||
.platformService()
|
||||
.isElectron();
|
||||
// @ts-expect-error Accessing computed property value from Vue instance
|
||||
return this["platformService"].isElectron();
|
||||
},
|
||||
|
||||
/**
|
||||
* Platform capabilities
|
||||
*/
|
||||
capabilities() {
|
||||
return (this as unknown as VueComponentWithMixin)
|
||||
.platformService()
|
||||
.getCapabilities();
|
||||
// @ts-expect-error Accessing computed property value from Vue instance
|
||||
return this["platformService"].getCapabilities();
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user