Verified Commit 6b046fef authored by FabioWidmer's avatar FabioWidmer
Browse files

Update to v1.0.1

parent ee872c44
......@@ -43,7 +43,7 @@ module.exports = {
devtool: env === 'production' ? 'source-map' : 'eval',
devServer: {
hot: false, //Changed
open: true,
open: false,
compress: true,
contentBase: '/www/',
disableHostCheck: true,
......
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ablota.store" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.ablota.store" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Ablota Store</name>
<description>The universal, decentralized and open source app store.</description>
<author email="info@ablota.com" href="https://ablota.com">Ablota (StarApps GmbH)</author>
......@@ -29,16 +29,16 @@
<preference name="StatusBarOverlaysWebView" value="true" />
<platform name="android">
<splash density="hdpi" src="res/screen/android/drawable-hdpi/screen.png"/>
<splash density="mdpi" src="res/screen/android/drawable-mdpi/screen.png"/>
<splash density="xhdpi" src="res/screen/android/drawable-xhdpi/screen.png"/>
<splash density="xxhdpi" src="res/screen/android/drawable-xxhdpi/screen.png"/>
<splash density="xxxhdpi" src="res/screen/android/drawable-xxxhdpi/screen.png"/>
<splash density="land-hdpi" src="res/screen/android/drawable-hdpi/screen.png"/>
<splash density="land-mdpi" src="res/screen/android/drawable-mdpi/screen.png"/>
<splash density="land-xhdpi" src="res/screen/android/drawable-xhdpi/screen.png"/>
<splash density="land-xxhdpi" src="res/screen/android/drawable-xxhdpi/screen.png"/>
<splash density="land-xxxhdpi" src="res/screen/android/drawable-xxxhdpi/screen.png"/>
<splash density="port-hdpi" src="res/screen/android/drawable-hdpi/screen.png"/>
<splash density="port-mdpi" src="res/screen/android/drawable-mdpi/screen.png"/>
<splash density="port-xhdpi" src="res/screen/android/drawable-xhdpi/screen.png"/>
<splash density="port-xxhdpi" src="res/screen/android/drawable-xxhdpi/screen.png"/>
<splash density="port-xxxhdpi" src="res/screen/android/drawable-xxxhdpi/screen.png"/>
<icon density="ldpi" src="res/icon/android/mipmap-ldpi/ic_launcher.png"/>
<icon density="mdpi" src="res/icon/android/mipmap-mdpi/ic_launcher.png"/>
......
This diff is collapsed.
{
"name": "com.ablota.store",
"displayName": "Ablota Store",
"version": "1.0.0",
"version": "1.0.1",
"cordova": {
"plugins": {
"cordova-plugin-statusbar": {},
......@@ -12,12 +12,12 @@
"cordova-plugin-file": {},
"cordova-plugin-device": {},
"cordova-plugin-network-information": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-x-socialsharing": {
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
},
"cordova-plugin-splashscreen": {},
"cordova-plugin-inappbrowser": {},
"ablota-store-cordova-plugin": {}
},
"platforms": [
......@@ -27,14 +27,14 @@
]
},
"devDependencies": {
"@ablota/store-cordova-plugin": "^1.0.1",
"@ablota/store-cordova-plugin": "^1.0.2",
"cordova-android": "^9.0.0",
"cordova-clipboard": "^1.3.0",
"cordova-electron": "^2.0.0",
"cordova-ios": "^6.1.1",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-inappbrowser": "^4.0.0",
"cordova-plugin-inappbrowser": "^4.1.0",
"cordova-plugin-keyboard": "^1.2.0",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-splashscreen": "^6.0.0",
......
This diff is collapsed.
......@@ -25,48 +25,48 @@
"dependencies": {
"@hapi/joi": "^17.1.1",
"dom7": "^2.1.5",
"framework7": "^5.7.13",
"framework7": "^5.7.14",
"framework7-icons": "^3.0.1",
"framework7-vue": "^5.7.13",
"framework7-vue": "^5.7.14",
"qrcode": "^1.4.4",
"sanitize-html": "^2.1.1",
"sanitize-html": "^2.3.0",
"template7": "^1.4.2",
"vue": "^2.6.12",
"vue-i18n": "^8.22.1",
"vuex": "^3.5.1"
"vue-i18n": "^8.22.2",
"vuex": "^3.6.0"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/core": "^7.12.10",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/runtime": "^7.12.1",
"babel-loader": "^8.1.0",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/runtime": "^7.12.5",
"babel-loader": "^8.2.2",
"chalk": "^4.1.0",
"concurrently": "^5.3.0",
"copy-webpack-plugin": "^6.2.1",
"copy-webpack-plugin": "^6.4.1",
"cpy-cli": "^3.1.1",
"cross-env": "^7.0.2",
"cross-env": "^7.0.3",
"css-loader": "^4.3.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^4.5.0",
"mini-css-extract-plugin": "^0.11.3",
"node-sass": "^4.14.1",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"ora": "^5.1.0",
"postcss-loader": "^4.0.4",
"ora": "^5.2.0",
"postcss-loader": "^4.1.0",
"postcss-preset-env": "^6.7.0",
"rimraf": "^3.0.2",
"sass-loader": "^10.0.4",
"sass-loader": "^10.1.0",
"style-loader": "^1.3.0",
"terser-webpack-plugin": "^4.2.3",
"url-loader": "^4.1.1",
"vue-loader": "^15.9.4",
"vue-loader": "^15.9.6",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-dev-server": "^3.11.1",
"workbox-webpack-plugin": "^5.1.4"
}
}
......@@ -18,7 +18,7 @@
f7params: {
id: 'com.ablota.store',
name: 'Ablota Store',
version: '1.0.0',
version: '1.0.1',
theme: 'auto',
data: function() {
return {
......@@ -26,6 +26,7 @@
server: {
url: 'https://api.store.ablota.com/'
},
deviceInfo: null,
};
},
autoDarkTheme: true,
......
......@@ -26,6 +26,13 @@ body {
}
}
.item-padding-half {
.item-inner {
padding-top: calc(var(--f7-list-item-padding-vertical) / 2);
padding-bottom: calc(var(--f7-list-item-padding-vertical) / 2);
}
}
.overlay-center {
position: absolute !important;
top: 50%;
......@@ -69,6 +76,15 @@ body {
}
}
.accordion-text {
.item-inner {
padding: 0;
}
.item-subtitle p {
margin-top: 0;
}
}
.position-fixed {
position: fixed;
}
......@@ -83,6 +83,10 @@ export default {
title: 'Bitwarden',
description: 'Bitwarden, the open source password manager, makes it easy to generate and store unique passwords for any browser or device.',
},
newPipe: {
title: 'NewPipe',
description: 'A libre lightweight streaming frontend for Android.',
},
},
errors: {
validation: 'The ',
......@@ -106,16 +110,25 @@ export default {
},
},
app: {
details: 'Metadata about the package suggested by the source.',
permissions: 'The app can use or request the following permissions.',
features: 'The app can use the following hardware and software features.',
hashes: 'The hashes are used to verify the app to detect malicious changes.',
donate: 'Express your appreciation for the development and work related to this app by contributing a monthly or one-time donation.',
install: {
success: 'The app has been successfully installed and can now be used.',
failure: 'The installation of the app has failed.',
},
reinstall: 'In order to install the suggested update the old version must first be uninstalled. This only happens if the update has not been published by the same developer. Please only do this if you trust the source.',
launch: 'An error occurred while launching the app.',
share: {
title: '@:app.name: {app}',
text: '{summary}\n\nGet the app "{app}" now with @:(app.name).',
},
crypto: {
text: 'It is possible that no application has opened for the donation. If this is the case, you can copy the address here and make the donation with your crypto wallet.',
clipboard: 'The address for donating was copied to the clipboard.',
},
},
source: {
footer: 'Updated {date}, Version {version}',
......@@ -178,6 +191,10 @@ export default {
clipboard: 'The text for sharing was copied to the clipboard.',
console: 'The text for sharing could not be copied to the clipboard. It was now printed in the console.',
},
suggestPackage: {
deviceInfo: 'An error occurred while getting information about the device.',
packageInfo: 'An error occurred while getting information about the package.',
},
},
words: {
more: 'More',
......@@ -188,11 +205,13 @@ export default {
address: 'Address',
mirrors: 'Mirrors',
sha256: 'SHA-256',
sha512: 'SHA-512',
ok: 'OK',
cancel: 'Cancel',
add: 'Add',
remove: 'Remove',
description: 'Description',
version: 'Version',
versions: 'Versions',
screenshots: 'Screenshots',
whatsNew: 'What\'s New',
......@@ -237,6 +256,20 @@ export default {
update: 'Update',
step: 'Step',
done: 'Done',
hashes: 'Hashes',
details: 'Details',
date: 'Date',
minSdkVersion: 'Minimum SDK Version',
targetSdkVersion: 'Target SDK Version',
maxSdkVersion: 'Maximum SDK Version',
abis: 'ABIs',
size: 'Size',
apk: 'APK',
obbMain: 'OBB-Main',
obbPatch: 'OBB-Patch',
permissions: 'Permissions',
features: 'Features',
copy: 'Copy',
},
counts: {
apps: '1 App | {count} Apps',
......@@ -287,6 +320,10 @@ export default {
title: 'No Source Since',
description: 'The upstream source for this app is no longer available. Either the app went proprietary, the source repository was dropped, or it has moved to a location currently not known to us. This means there will not be further updates unless the source reappears.',
},
ApplicationDebuggable: {
title: 'Application Debuggable',
description: 'This Anti-Feature is applied to apps that are debuggable.',
},
},
},
popups: {
......
......@@ -261,7 +261,7 @@ export function localizeApp(app, language) {
allowedSchemes: ['http', 'https', 'mailto'],
allowProtocolRelative: false,
transformTags: {
'a': sanitizeHtml.simpleTransform('a', {
a: sanitizeHtml.simpleTransform('a', {
class: 'link external',
target: '_system',
}),
......@@ -455,6 +455,75 @@ export function share({title, text, url}) {
});
}
export function suggestPackage(app, packages, deviceInfo) {
return new Promise((resolve, reject) => {
if(deviceInfo && deviceInfo.status === 'success') {
ablota.store.package.info(app.packageName, packageInfo => {
const allPackages = packages.filter(appPackage => {
if(appPackage.minSdkVersion && deviceInfo.sdk < appPackage.minSdkVersion) {
return false;
} else if(appPackage.maxSdkVersion && deviceInfo.sdk > appPackage.maxSdkVersion) {
return false;
} else if(appPackage.nativecode.length && !deviceInfo.abis.some(abi => appPackage.nativecode.includes(abi))) {
return false;
}
return true;
}).sort((a, b) => a.versionCode < b.versionCode);
const compatiblePackages = allPackages.filter(appPackage => {
if(packageInfo.status === 'success') {
if(appPackage.signer && !packageInfo.package.signatures.includes(appPackage.signer)) {
return false;
} else if(packageInfo.package.versionCode > appPackage.versionCode) {
return false;
}
}
return true;
});
if(allPackages.length) {
let suggestion = compatiblePackages.find(appPackage => appPackage.versionCode === app.suggestedVersionCode);
if(!suggestion) {
suggestion = compatiblePackages.find(appPackage => appPackage.versionName === app.suggestedVersionName);
}
if(!suggestion && allPackages.length > compatiblePackages.length) {
suggestion = allPackages.find(appPackage => appPackage.versionCode === app.suggestedVersionCode);
if(!suggestion) {
suggestion = allPackages.find(appPackage => appPackage.versionName === app.suggestedVersionName);
}
}
if(!suggestion) {
if(allPackages[0].versionName === compatiblePackages[0].versionName) {
suggestion = compatiblePackages[0];
} else {
suggestion = allPackages[0];
}
}
resolve({
package: suggestion,
packages: compatiblePackages,
installed: packageInfo.status === 'success',
outdated: packageInfo.status === 'success' && suggestion.versionCode > packageInfo.package.versionCode,
reinstall: packageInfo.status === 'success' && suggestion.signer && !packageInfo.package.signatures.includes(suggestion.signer),
});
} else {
resolve({
package: null,
packages: [],
installed: packageInfo.status === 'success',
outdated: false,
reinstall: false,
});
}
}, () => reject('utils.suggestPackage.packageInfo'));
} else {
reject('utils.suggestPackage.deviceInfo');
}
});
}
export function splitArray(array, size) {
return Array.from({length: Math.ceil(array.length / size)}, (v, i) => array.slice(i * size, i * size + size));
}
......@@ -29,18 +29,28 @@
<popover-anti-features/>
<popup-download-app/>
<f7-fab
v-show="app && packages.length"
v-show="app && suggestion.package && (!suggestion.installed || suggestion.outdated || suggestion.reinstall)"
slot="fixed"
:text="packageUpdate ? $t('words.update') : $t('words.install')"
:text="suggestion.outdated ? $t('words.update') : $t('words.install')"
class="fab-install no-margin-bottom"
morph-to=".toolbar-progress"
position="center-bottom"
@click="installPackage(packageSuggestion)"
@click="installPackage(suggestion.package)"
>
<f7-icon aurora="f7:plus" ios="f7:plus" md="material:add"></f7-icon>
</f7-fab>
<f7-fab v-show="app && !packages.length" slot="fixed" :text="$t('words.uninstall')" class="fab-uninstall no-margin-bottom" position="center-bottom" @click="uninstallApp">
<f7-icon aurora="f7:minus" ios="f7:minus" md="material:remove"></f7-icon>
<f7-fab
v-show="app && suggestion.installed && !suggestion.outdated && !suggestion.reinstall"
slot="fixed"
:text="$t('words.launch')"
class="fab-launch no-margin-bottom"
position="center-bottom"
@click="launchApp()"
>
<f7-icon aurora="f7:arrow_up_right_square" ios="f7:arrow_up_right_square" md="material:launch"></f7-icon>
</f7-fab>
<f7-fab v-show="app && suggestion.installed" slot="fixed" :tooltip="$t('words.uninstall')" class="fab-uninstall no-margin-bottom" position="right-bottom" @click="uninstallApp">
<f7-icon aurora="f7:trash" ios="f7:trash" md="material:delete"></f7-icon>
</f7-fab>
<div v-if="app">
<f7-popover class="popover-packages">
......@@ -48,7 +58,7 @@
<f7-list-item
v-for="appPackage in packages"
:key="appPackage.hash"
:badge="appPackage.versionCode === app.suggestedVersionCode || appPackage.versionName === app.suggestedVersionName ? $t('words.suggestion') : ''"
:badge="suggestion.package && appPackage.hash === suggestion.package.hash ? $t('words.suggestion') : ''"
:footer="`${appPackage.added.toLocaleDateString()}, ${Math.round(appPackage.size / 1024 / 1024 * 10) / 10} MB`"
:title="`${appPackage.versionName} (${appPackage.versionCode})`"
link
......@@ -69,25 +79,61 @@
</f7-popover>
<f7-list accordion-list class="no-margin" media-list no-hairlines>
<f7-list-item
:accordion-item="!!(app.description || app.whatsNew)" :footer="app.packageName" :subtitle="app.summary" class="no-subtitle-limit"
:accordion-item="!!suggestion.package"
:footer="app.packageName"
:subtitle="app.summary"
class="no-subtitle-limit"
>
<img v-if="appIcon" slot="media" :src="appIcon" alt="" class="icon-60"/>
<f7-skeleton-block v-if="app.icon && !appIcon" slot="media" class="icon-60"/>
<f7-link v-if="app.authorName && (app.authorEmail || app.authorWebSite)" slot="text" popover-open=".popover-author" v-html="app.authorName"/>
<span v-else-if="app.authorName" slot="text" v-html="app.authorName"/>
<f7-accordion-content>
<div v-if="app.description">
<f7-block-title>{{ $t('words.description') }}</f7-block-title>
<f7-block v-html="app.description"></f7-block>
<f7-accordion-content v-if="suggestion.package">
<f7-block-title class="no-margin-top">{{ $t('words.details') }}</f7-block-title>
<f7-block>
<p>{{ $t('pages.app.details') }}</p>
</f7-block>
<f7-list class="no-title-limit item-padding-half" inset>
<f7-list-item :title="suggestion.package.added.toLocaleDateString()" :header="$t('words.date')"></f7-list-item>
<f7-list-item :title="`${suggestion.package.versionName} (${suggestion.package.versionCode})`" :header="$t('words.version')"></f7-list-item>
<f7-list-item :title="`${Math.round(suggestion.package.size / 1024 / 1024 * 10) / 10} MB`" :header="$t('words.size')"></f7-list-item>
<f7-list-item v-if="suggestion.package.minSdkVersion" :title="suggestion.package.minSdkVersion" :header="$t('words.minSdkVersion')"></f7-list-item>
<f7-list-item v-if="suggestion.package.targetSdkVersion" :title="suggestion.package.targetSdkVersion" :header="$t('words.targetSdkVersion')"></f7-list-item>
<f7-list-item v-if="suggestion.package.maxSdkVersion" :title="suggestion.package.maxSdkVersion" :header="$t('words.maxSdkVersion')"></f7-list-item>
<f7-list-item v-if="suggestion.package.nativecode.length" :title="suggestion.package.nativecode.join(', ')" :header="$t('words.abis')"></f7-list-item>
</f7-list>
<div v-if="Object.keys(permissions).length">
<f7-block-title>{{ $t('words.permissions') }}</f7-block-title>
<f7-block>
<p>{{ $t('pages.app.permissions') }}</p>
</f7-block>
<f7-list class="no-title-limit item-padding-half" inset>
<f7-list-item v-for="(value, name) in permissions" :title="value" :header="name"></f7-list-item>
</f7-list>
</div>
<div v-if="app.whatsNew">
<f7-block-title>{{ $t('words.whatsNew') }}</f7-block-title>
<f7-block v-html="app.whatsNew"></f7-block>
<div v-if="suggestion.package.features.length">
<f7-block-title>{{ $t('words.features') }}</f7-block-title>
<f7-block>
<p>{{ $t('pages.app.features') }}</p>
</f7-block>
<f7-list class="no-title-limit item-padding-half" inset>
<f7-list-item v-for="feature in suggestion.package.features" :title="feature" :header="feature"></f7-list-item>
</f7-list>
</div>
<f7-block-title>{{ $t('words.hashes') }}</f7-block-title>
<f7-block>
<p>{{ $t('pages.app.hashes') }}</p>
</f7-block>
<f7-list class="no-title-limit item-padding-half" inset>
<f7-list-item v-if="suggestion.package.hashType === 'sha256'" :title="suggestion.package.hash.match(/.{1,2}/g).join(':').toUpperCase()" :header="`${$t('words.apk')} (${$t('words.sha256')})`"></f7-list-item>
<f7-list-item v-if="suggestion.package.hashType === 'sha512'" :title="suggestion.package.hash.match(/.{1,2}/g).join(':').toUpperCase()" :header="`${$t('words.apk')} (${$t('words.sha512')})`"></f7-list-item>
<f7-list-item v-if="suggestion.package.obbMainFileSha256" :title="suggestion.package.obbMainFileSha256.match(/.{1,2}/g).join(':').toUpperCase()" :header="`${$t('words.obbMain')} (${$t('words.sha256')})`"></f7-list-item>
<f7-list-item v-if="suggestion.package.obbPatchFileSha256" :title="suggestion.package.obbPatchFileSha256.match(/.{1,2}/g).join(':').toUpperCase()" :header="`${$t('words.obbPatch')} (${$t('words.sha256')})`"></f7-list-item>
</f7-list>
</f7-accordion-content>
</f7-list-item>
</f7-list>
<f7-block v-if="appGraphicsBundle.length">
<f7-block v-if="appGraphicsBundle.length" class="no-margin">
<f7-swiper :params="{effect: 'cube', centeredSlides: true, loop: appGraphicsBundle.length > 1, autoplay: {delay: 10000}, }">
<f7-swiper-slide v-for="(graphic, index) in appGraphicsBundle" :key="index">
<img v-if="appGraphics[graphic]" :src="appGraphics[graphic]" alt="" class="width-100" @click="graphicsPhotoBrowser.open(index)"/>
......@@ -108,13 +154,30 @@
</f7-swiper-slide>
</f7-swiper>
</f7-block>
<div v-if="app.whatsNew">
<f7-block-title>{{ $t('words.whatsNew') }}</f7-block-title>
<f7-block v-html="app.whatsNew"></f7-block>
</div>
<div v-if="app.description">
<f7-block-title>{{ $t('words.description') }}</f7-block-title>
<f7-list accordion-list class="no-margin" media-list no-hairlines>
<f7-list-item
:accordion-item="app.description.length > 500" class="no-subtitle-limit accordion-text"
>
<span slot="title" class="item-subtitle" v-html="`${app.description.replace(/^(.{500}[^\s]*).*/, '$1')}${app.description.length > 500 ? '...' : ''}`"/>
<f7-accordion-content>
<f7-block class="no-margin" v-html="`...${app.description.replace(app.description.replace(/^(.{500}[^\s]*).*/, '$1'), '')}`"></f7-block>
</f7-accordion-content>
</f7-list-item>
</f7-list>
</div>
<div v-if="appScreenshotsBundle.length">
<f7-block-title>{{ $t('words.screenshots') }}</f7-block-title>
<f7-block>
<f7-swiper :params="{slidesPerView: 3.5, spaceBetween: 20}">
<f7-swiper-slide v-for="(screenshot, index) in appScreenshotsBundle.flat()" :key="index">
<img v-if="appScreenshots[screenshot]" :src="appScreenshots[screenshot]" alt="" class="width-100" @click="screenshotsPhotoBrowser.open(index)"/>
<f7-skeleton-block v-else height="30vh" width="100%"/>
<f7-skeleton-block v-else height="20vh" width="100%"/>
</f7-swiper-slide>
</f7-swiper>
</f7-block>
......@@ -123,9 +186,9 @@
<f7-card>
<f7-card-content class="text-align-center">
<p>{{ $t('pages.app.donate') }}</p>
<a v-if="app.bitcoin" :href="`bitcoin:${app.bitcoin}?message=${app.name}`" class="chip color-orange external">
<a v-if="app.bitcoin" :href="`bitcoin:${app.bitcoin}?message=${app.name}`" class="chip color-orange external" @click="crypto(app.bitcoin)">
<div class="chip-label">{{ $t('words.bitcoin') }}</div>
</a> <a v-if="app.litecoin" :href="`litecoin:${app.litecoin}?message=${app.name}`" class="chip color-blue external">
</a> <a v-if="app.litecoin" :href="`litecoin:${app.litecoin}?message=${app.name}`" class="chip color-blue external" @click="crypto(app.litecoin)">
<div class="chip-label">{{ $t('words.litecoin') }}</div>
</a> <a v-if="app.liberapayID" :href="`https://liberapay.com/~${app.liberapayID}`" class="chip color-yellow external" target="_system">
<div class="chip-label">{{ $t('words.liberapay') }}</div>
......@@ -193,7 +256,7 @@
</template>
<script>
import {Device} from 'framework7';
import {downloadPackage, fetchIcons, share} from '../js/utils';
import {downloadPackage, fetchIcons, share, suggestPackage} from '../js/utils';
import ChipAntiFeature from '../components/chips/antifeature';
import PopoverAntiFeatures from '../components/popovers/antifeatures';
import PopupDownloadApp from '../components/popups/downloadapp';
......@@ -216,15 +279,14 @@ export default {
appGraphics: {},
appScreenshots: {},
packages: [],
packageUpdate: false,
packageSuggestion: null,
suggestion: {},
permissions: {},
progress: {
value: 0,
status: null,
label: null,
},
installPackageCancelled: false,
deviceInfo: {},
};
},
computed: {
......@@ -248,6 +310,8 @@ export default {
.map(screenshots => this.app[screenshots]);
},
appPackages: function() {
if(this.loading) return [];
return this.$store.getters['sources/getPackages'](this.appId, this.sourceId);
},
graphicsPhotoBrowser: function() {
......@@ -308,6 +372,14 @@ export default {
return;
}
if(this.suggestion.reinstall) {
setTimeout(() => this.$f7.fab.close('.fab-install'), 1000);
this.$f7.dialog.confirm(this.$t('pages.app.reinstall'), () => {
this.uninstallApp();
});
return;
}
this.installPackageCancelled = false;
......@@ -362,12 +434,7 @@ export default {
text: this.$t('pages.app.install.success'),
closeButtonText: this.$t('words.launch'),
on: {
closeButtonClick: () => {
ablota.store.package.launch(appPackage.packageName, () => {
}, () => {
this.$f7.dialog.alert(this.$t('pages.app.launch'));
});
},
closeButtonClick: () => this.launchApp(),
},
});
this.$f7.fab.close('.fab-install');
......@@ -379,7 +446,7 @@ export default {
}
this.checkPackages();
}, () => {
}, data => {
this.$f7.dialog.alert(this.$t(data));
this.$f7.fab.close('.fab-install');
});
......@@ -397,40 +464,48 @@ export default {
setTimeout(() => this.$f7.fab.close('.fab-install'), 1000);
},
launchApp: function() {
if(!Device.cordova) return;