diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index e697f98..a56c490 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,38 +1,31 @@ - + - + + + - + + + + + + + + + + + - - + + diff --git a/android/app/src/main/java/io/ionic/starter/MainActivity.java b/android/app/src/main/java/io/ionic/starter/MainActivity.java index 73e3a98..ea84877 100644 --- a/android/app/src/main/java/io/ionic/starter/MainActivity.java +++ b/android/app/src/main/java/io/ionic/starter/MainActivity.java @@ -1,5 +1,23 @@ package io.ionic.starter; import com.getcapacitor.BridgeActivity; +import android.content.Intent; +import android.webkit.ValueCallback; -public class MainActivity extends BridgeActivity {} +public class MainActivity extends BridgeActivity { + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + String action = intent.getAction(); + String type = intent.getType(); + if (Intent.ACTION_SEND.equals(action) /*|| Intent.ACTION_SEND_MULTIPLE.equals(action))*/ && type != null) { + bridge.getActivity().setIntent(intent); + bridge.eval("window.dispatchEvent(new Event('sendIntentReceived'))", new ValueCallback() { + @Override + public void onReceiveValue(String s) { + } + }); + } + } +} diff --git a/android/app/src/main/res/drawable-land-hdpi/splash.png b/android/app/src/main/res/drawable-land-hdpi/splash.png index e31573b..76fbf1e 100644 Binary files a/android/app/src/main/res/drawable-land-hdpi/splash.png and b/android/app/src/main/res/drawable-land-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-mdpi/splash.png b/android/app/src/main/res/drawable-land-mdpi/splash.png index f7a6492..4644973 100644 Binary files a/android/app/src/main/res/drawable-land-mdpi/splash.png and b/android/app/src/main/res/drawable-land-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xhdpi/splash.png b/android/app/src/main/res/drawable-land-xhdpi/splash.png index 8077255..876ef21 100644 Binary files a/android/app/src/main/res/drawable-land-xhdpi/splash.png and b/android/app/src/main/res/drawable-land-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxhdpi/splash.png index 14c6c8f..1ebcc73 100644 Binary files a/android/app/src/main/res/drawable-land-xxhdpi/splash.png and b/android/app/src/main/res/drawable-land-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png index 244ca25..b3ddc5e 100644 Binary files a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-hdpi/splash.png b/android/app/src/main/res/drawable-port-hdpi/splash.png index 74faaa5..b11b89f 100644 Binary files a/android/app/src/main/res/drawable-port-hdpi/splash.png and b/android/app/src/main/res/drawable-port-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-mdpi/splash.png b/android/app/src/main/res/drawable-port-mdpi/splash.png index e944f4a..e3ae7b1 100644 Binary files a/android/app/src/main/res/drawable-port-mdpi/splash.png and b/android/app/src/main/res/drawable-port-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xhdpi/splash.png b/android/app/src/main/res/drawable-port-xhdpi/splash.png index 564a82f..4060e5b 100644 Binary files a/android/app/src/main/res/drawable-port-xhdpi/splash.png and b/android/app/src/main/res/drawable-port-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxhdpi/splash.png index bfabe68..4371c15 100644 Binary files a/android/app/src/main/res/drawable-port-xxhdpi/splash.png and b/android/app/src/main/res/drawable-port-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png index 6929071..d817c55 100644 Binary files a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png index f7a6492..4644973 100644 Binary files a/android/app/src/main/res/drawable/splash.png and b/android/app/src/main/res/drawable/splash.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index c023e50..a3459e7 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png index 2127973..eef7c36 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index b441f37..a3459e7 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 72905b8..f84e39b 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png index 8ed0605..38f70d8 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 9502e47..f84e39b 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 4d1e077..666119a 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png index df0f158..c05ffe5 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 853db04..666119a 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 6cdf97c..e78429f 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png index 2960cbb..d051b1c 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 8e3093a..e78429f 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 46de6e2..df9b7f9 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png index d2ea9ab..e641bfc 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index a40d73e..df9b7f9 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png index d1e4437..a8d16c1 100644 Binary files a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png index d1e4437..a8d16c1 100644 Binary files a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png index d1e4437..a8d16c1 100644 Binary files a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png differ diff --git a/resources/android/icon/drawable-hdpi-icon.png b/resources/android/icon/drawable-hdpi-icon.png index eef7c36..a3459e7 100644 Binary files a/resources/android/icon/drawable-hdpi-icon.png and b/resources/android/icon/drawable-hdpi-icon.png differ diff --git a/resources/android/icon/drawable-ldpi-icon.png b/resources/android/icon/drawable-ldpi-icon.png index f854419..d72bd9e 100644 Binary files a/resources/android/icon/drawable-ldpi-icon.png and b/resources/android/icon/drawable-ldpi-icon.png differ diff --git a/resources/android/icon/drawable-mdpi-icon.png b/resources/android/icon/drawable-mdpi-icon.png index 38f70d8..f84e39b 100644 Binary files a/resources/android/icon/drawable-mdpi-icon.png and b/resources/android/icon/drawable-mdpi-icon.png differ diff --git a/resources/android/icon/drawable-xhdpi-icon.png b/resources/android/icon/drawable-xhdpi-icon.png index c05ffe5..666119a 100644 Binary files a/resources/android/icon/drawable-xhdpi-icon.png and b/resources/android/icon/drawable-xhdpi-icon.png differ diff --git a/resources/android/icon/drawable-xxhdpi-icon.png b/resources/android/icon/drawable-xxhdpi-icon.png index d051b1c..e78429f 100644 Binary files a/resources/android/icon/drawable-xxhdpi-icon.png and b/resources/android/icon/drawable-xxhdpi-icon.png differ diff --git a/resources/android/icon/drawable-xxxhdpi-icon.png b/resources/android/icon/drawable-xxxhdpi-icon.png index e641bfc..df9b7f9 100644 Binary files a/resources/android/icon/drawable-xxxhdpi-icon.png and b/resources/android/icon/drawable-xxxhdpi-icon.png differ diff --git a/resources/android/splash/drawable-land-hdpi-screen.png b/resources/android/splash/drawable-land-hdpi-screen.png index 1563e5d..76fbf1e 100644 Binary files a/resources/android/splash/drawable-land-hdpi-screen.png and b/resources/android/splash/drawable-land-hdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-ldpi-screen.png b/resources/android/splash/drawable-land-ldpi-screen.png index de9b917..9882f0b 100644 Binary files a/resources/android/splash/drawable-land-ldpi-screen.png and b/resources/android/splash/drawable-land-ldpi-screen.png differ diff --git a/resources/android/splash/drawable-land-mdpi-screen.png b/resources/android/splash/drawable-land-mdpi-screen.png index 42b3dd1..4644973 100644 Binary files a/resources/android/splash/drawable-land-mdpi-screen.png and b/resources/android/splash/drawable-land-mdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xhdpi-screen.png b/resources/android/splash/drawable-land-xhdpi-screen.png index f3f0e1f..876ef21 100644 Binary files a/resources/android/splash/drawable-land-xhdpi-screen.png and b/resources/android/splash/drawable-land-xhdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xxhdpi-screen.png b/resources/android/splash/drawable-land-xxhdpi-screen.png index adc9dd3..1ebcc73 100644 Binary files a/resources/android/splash/drawable-land-xxhdpi-screen.png and b/resources/android/splash/drawable-land-xxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xxxhdpi-screen.png b/resources/android/splash/drawable-land-xxxhdpi-screen.png index 9183251..b3ddc5e 100644 Binary files a/resources/android/splash/drawable-land-xxxhdpi-screen.png and b/resources/android/splash/drawable-land-xxxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-hdpi-screen.png b/resources/android/splash/drawable-port-hdpi-screen.png index b71cc85..b11b89f 100644 Binary files a/resources/android/splash/drawable-port-hdpi-screen.png and b/resources/android/splash/drawable-port-hdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-ldpi-screen.png b/resources/android/splash/drawable-port-ldpi-screen.png index 7e62464..4a0ab3b 100644 Binary files a/resources/android/splash/drawable-port-ldpi-screen.png and b/resources/android/splash/drawable-port-ldpi-screen.png differ diff --git a/resources/android/splash/drawable-port-mdpi-screen.png b/resources/android/splash/drawable-port-mdpi-screen.png index 37da713..e3ae7b1 100644 Binary files a/resources/android/splash/drawable-port-mdpi-screen.png and b/resources/android/splash/drawable-port-mdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xhdpi-screen.png b/resources/android/splash/drawable-port-xhdpi-screen.png index 5127f91..4060e5b 100644 Binary files a/resources/android/splash/drawable-port-xhdpi-screen.png and b/resources/android/splash/drawable-port-xhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xxhdpi-screen.png b/resources/android/splash/drawable-port-xxhdpi-screen.png index 1879ea3..4371c15 100644 Binary files a/resources/android/splash/drawable-port-xxhdpi-screen.png and b/resources/android/splash/drawable-port-xxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xxxhdpi-screen.png b/resources/android/splash/drawable-port-xxxhdpi-screen.png index 9388ae8..d817c55 100644 Binary files a/resources/android/splash/drawable-port-xxxhdpi-screen.png and b/resources/android/splash/drawable-port-xxxhdpi-screen.png differ diff --git a/resources/ios/splash/Default-1792h~iphone.png b/resources/ios/splash/Default-1792h~iphone.png index 91a88f4..fdec99e 100644 Binary files a/resources/ios/splash/Default-1792h~iphone.png and b/resources/ios/splash/Default-1792h~iphone.png differ diff --git a/resources/ios/splash/Default-2436h.png b/resources/ios/splash/Default-2436h.png index 9327186..5405532 100644 Binary files a/resources/ios/splash/Default-2436h.png and b/resources/ios/splash/Default-2436h.png differ diff --git a/resources/ios/splash/Default-2688h~iphone.png b/resources/ios/splash/Default-2688h~iphone.png index 1fe9cf8..4429e61 100644 Binary files a/resources/ios/splash/Default-2688h~iphone.png and b/resources/ios/splash/Default-2688h~iphone.png differ diff --git a/resources/ios/splash/Default-568h@2x~iphone.png b/resources/ios/splash/Default-568h@2x~iphone.png index 62b49e5..c22dcf9 100644 Binary files a/resources/ios/splash/Default-568h@2x~iphone.png and b/resources/ios/splash/Default-568h@2x~iphone.png differ diff --git a/resources/ios/splash/Default-667h.png b/resources/ios/splash/Default-667h.png index 6dbb9c9..936ac92 100644 Binary files a/resources/ios/splash/Default-667h.png and b/resources/ios/splash/Default-667h.png differ diff --git a/resources/ios/splash/Default-736h.png b/resources/ios/splash/Default-736h.png index dfe9f6c..7829cd1 100644 Binary files a/resources/ios/splash/Default-736h.png and b/resources/ios/splash/Default-736h.png differ diff --git a/resources/ios/splash/Default-Landscape-1792h~iphone.png b/resources/ios/splash/Default-Landscape-1792h~iphone.png index 6d7b8a9..9667810 100644 Binary files a/resources/ios/splash/Default-Landscape-1792h~iphone.png and b/resources/ios/splash/Default-Landscape-1792h~iphone.png differ diff --git a/resources/ios/splash/Default-Landscape-2436h.png b/resources/ios/splash/Default-Landscape-2436h.png index a125e4b..1f6855f 100644 Binary files a/resources/ios/splash/Default-Landscape-2436h.png and b/resources/ios/splash/Default-Landscape-2436h.png differ diff --git a/resources/ios/splash/Default-Landscape-2688h~iphone.png b/resources/ios/splash/Default-Landscape-2688h~iphone.png index 4807d5e..278c7bd 100644 Binary files a/resources/ios/splash/Default-Landscape-2688h~iphone.png and b/resources/ios/splash/Default-Landscape-2688h~iphone.png differ diff --git a/resources/ios/splash/Default-Landscape-736h.png b/resources/ios/splash/Default-Landscape-736h.png index 9e14349..935663a 100644 Binary files a/resources/ios/splash/Default-Landscape-736h.png and b/resources/ios/splash/Default-Landscape-736h.png differ diff --git a/resources/ios/splash/Default-Landscape@2x~ipad.png b/resources/ios/splash/Default-Landscape@2x~ipad.png index 10018b0..1eaee02 100644 Binary files a/resources/ios/splash/Default-Landscape@2x~ipad.png and b/resources/ios/splash/Default-Landscape@2x~ipad.png differ diff --git a/resources/ios/splash/Default-Landscape@~ipadpro.png b/resources/ios/splash/Default-Landscape@~ipadpro.png index 8ea7d88..bd974a8 100644 Binary files a/resources/ios/splash/Default-Landscape@~ipadpro.png and b/resources/ios/splash/Default-Landscape@~ipadpro.png differ diff --git a/resources/ios/splash/Default-Landscape~ipad.png b/resources/ios/splash/Default-Landscape~ipad.png index c4c1927..2ef019b 100644 Binary files a/resources/ios/splash/Default-Landscape~ipad.png and b/resources/ios/splash/Default-Landscape~ipad.png differ diff --git a/resources/ios/splash/Default-Portrait@2x~ipad.png b/resources/ios/splash/Default-Portrait@2x~ipad.png index f5721d8..0755d2c 100644 Binary files a/resources/ios/splash/Default-Portrait@2x~ipad.png and b/resources/ios/splash/Default-Portrait@2x~ipad.png differ diff --git a/resources/ios/splash/Default-Portrait@~ipadpro.png b/resources/ios/splash/Default-Portrait@~ipadpro.png index 4976459..01429bf 100644 Binary files a/resources/ios/splash/Default-Portrait@~ipadpro.png and b/resources/ios/splash/Default-Portrait@~ipadpro.png differ diff --git a/resources/ios/splash/Default-Portrait~ipad.png b/resources/ios/splash/Default-Portrait~ipad.png index 999eba8..3e96dfb 100644 Binary files a/resources/ios/splash/Default-Portrait~ipad.png and b/resources/ios/splash/Default-Portrait~ipad.png differ diff --git a/resources/ios/splash/Default@2x~iphone.png b/resources/ios/splash/Default@2x~iphone.png index 592b045..8a59347 100644 Binary files a/resources/ios/splash/Default@2x~iphone.png and b/resources/ios/splash/Default@2x~iphone.png differ diff --git a/resources/ios/splash/Default@2x~universal~anyany.png b/resources/ios/splash/Default@2x~universal~anyany.png index d1e4437..a8d16c1 100644 Binary files a/resources/ios/splash/Default@2x~universal~anyany.png and b/resources/ios/splash/Default@2x~universal~anyany.png differ diff --git a/resources/ios/splash/Default~iphone.png b/resources/ios/splash/Default~iphone.png index 37da713..e3ae7b1 100644 Binary files a/resources/ios/splash/Default~iphone.png and b/resources/ios/splash/Default~iphone.png differ diff --git a/resources/splash.png b/resources/splash.png index 77c5a1c..84a7f2e 100644 Binary files a/resources/splash.png and b/resources/splash.png differ diff --git a/src/app/show-folder/show-folder.component.ts b/src/app/show-folder/show-folder.component.ts index ac72b96..a5f9421 100644 --- a/src/app/show-folder/show-folder.component.ts +++ b/src/app/show-folder/show-folder.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input, CUSTOM_ELEMENTS_SCHEMA, Output, EventEmitter, ElementRef, ViewChild } from '@angular/core'; -import { AlertController, ToastController, IonicModule, ActionSheetController, ActionSheetButton, AlertOptions, ModalController, ModalOptions } from '@ionic/angular'; +import { AlertController, ToastController, IonicModule, ActionSheetController, ActionSheetButton, AlertOptions, ModalController, ModalOptions, LoadingController } from '@ionic/angular'; import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { StoragehubService } from '../storagehub.service'; @@ -15,6 +15,7 @@ import { Sorting, SortName, SortType } from '../model/sorting'; import { UploaderInfoService } from '../uploader-info.service'; import { EventService } from '../event.service'; import { OpenFile } from '../model/actions/open-file'; +import { presentConnectionAlert } from '../_helper/utils'; @Component({ standalone: true, @@ -30,7 +31,7 @@ import { OpenFile } from '../model/actions/open-file'; export class ShowFolderComponent implements OnInit { @Output() folderClickedEvent = new EventEmitter(); - + filteredItems: WSItem[] | undefined; _items: WSItem[] | undefined; @@ -71,7 +72,8 @@ export class ShowFolderComponent implements OnInit { private toastController: ToastController, private uploaderInfo: UploaderInfoService, private event: EventService, - private fileOpener: FileOpener + private fileOpener: FileOpener, + private loadingCtrl: LoadingController ) { this.underUpload = this.getUnderUploadItems(); } @@ -92,8 +94,8 @@ export class ShowFolderComponent implements OnInit { loadDocuments() { this.filteredItems = undefined; if (this.parentItem) { - this.storagehub.getChildren(this.parentItem.item.id).then((obs) => obs.subscribe( - (res) => { + this.storagehub.getChildren(this.parentItem.item.id).then((obs) => obs.subscribe({ + next: (res) => { const tmpItems$: WSItem[] = [] const tmpFiltered$: WSItem[] = [] var segmentFilterFunction = this.getSegmentFilterFunction(); @@ -106,7 +108,9 @@ export class ShowFolderComponent implements OnInit { this._items = tmpItems$.sort(Sorting.getSortFunction(this.currentSortName, this.currentSortType)); this.filteredItems = tmpFiltered$.sort(Sorting.getSortFunction(this.currentSortName, this.currentSortType)); this.underUpload = this.getUnderUploadItems(); - }) + }, + error: err => presentConnectionAlert(err, this.alertCtrl) + }) ) } } @@ -165,10 +169,10 @@ export class ShowFolderComponent implements OnInit { itemClicked(item: WSItem) { if (item.isFolder()) this.folderClickedEvent.emit(item); - else if (item.isFile()){ - new OpenFile().open(this.storagehub, this.fileOpener, item); + else if (item.isFile()) { + new OpenFile(item).open(this.storagehub, this.fileOpener, this.loadingCtrl, this.alertCtrl); } - + } diff --git a/src/app/trash/trash.page.ts b/src/app/trash/trash.page.ts index 77f68fa..707a0a8 100644 --- a/src/app/trash/trash.page.ts +++ b/src/app/trash/trash.page.ts @@ -1,8 +1,10 @@ import { Component, OnInit } from '@angular/core'; +import { AlertController } from '@ionic/angular'; import { lastValueFrom } from 'rxjs'; import { Item } from '../model/item.model'; import { WSItem } from '../model/ws-item'; import { StoragehubService } from '../storagehub.service'; +import { presentConnectionAlert } from '../_helper/utils'; @Component({ selector: 'app-trash', @@ -16,22 +18,26 @@ export class TrashPage implements OnInit { values: WSItem[] = []; - constructor(private storagehub: StoragehubService) { } + constructor(private storagehub: StoragehubService, private alertCtrl: AlertController) { } ngOnInit() { - this.storagehub.getTrashRoot().then((obs) => obs.subscribe( - (res) => this.onSuccess(res) + this.storagehub.getTrashRoot().then((obs) => obs.subscribe({ + next: (res) => this.onSuccess(res), + error: err => presentConnectionAlert(err, this.alertCtrl) + } )); } private onSuccess(res: Item) { - this.storagehub.getChildren(res.id, false).then((obs) => obs.subscribe( - (res) => { + this.storagehub.getChildren(res.id, false).then((obs) => obs.subscribe({ + next: (res) => { const tmpItems$: WSItem[] = [] res.forEach(i => tmpItems$.push(new WSItem(i))); this.values = tmpItems$; - } + }, + error: err => presentConnectionAlert(err, this.alertCtrl) + } )) } diff --git a/src/app/vres/vres.page.ts b/src/app/vres/vres.page.ts index e5b109d..c4c674e 100644 --- a/src/app/vres/vres.page.ts +++ b/src/app/vres/vres.page.ts @@ -1,8 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; +import { AlertController } from '@ionic/angular'; import { Item } from '../model/item.model'; import { WSItem } from '../model/ws-item'; import { StoragehubService } from '../storagehub.service'; +import { presentConnectionAlert } from '../_helper/utils'; @Component({ selector: 'app-vres', @@ -22,7 +24,8 @@ export class VresPage implements OnInit { constructor(private storagehub: StoragehubService, private router: Router, - private route: ActivatedRoute) { } + private route: ActivatedRoute, + private alertCtrl: AlertController) { } ngOnInit() { @@ -34,20 +37,24 @@ export class VresPage implements OnInit { this.root = !folderId; if (!tmpItem) { if (!folderId) - this.storagehub.getVres().then( (obs) => obs.subscribe( - (res) => { + this.storagehub.getVres().then((obs) => obs.subscribe({ + next: (res) => { const tmpItems$: WSItem[] = [] res.forEach(i => tmpItems$.push(new WSItem(i))); this.values = tmpItems$; - } - )); + }, + error: err => presentConnectionAlert(err, this.alertCtrl) + } + )) else //folder is not cached - this.storagehub.getItem(folderId).then( (obs) => obs.subscribe( - (res) => { + this.storagehub.getItem(folderId).then((obs) => obs.subscribe({ + next: (res) => { this.item = new WSItem(res); this.onSuccess(res) - } - )); + }, + error: err => presentConnectionAlert(err, this.alertCtrl) + } + )) } else { this.item = tmpItem; @@ -58,12 +65,14 @@ export class VresPage implements OnInit { private onSuccess(item: Item) { - this.storagehub.getChildren(item.id, false).then( (obs) => obs.subscribe( - (res) => { + this.storagehub.getChildren(item.id, false).then((obs) => obs.subscribe({ + next: (res) => { const tmpItems$: WSItem[] = [] res.forEach(i => tmpItems$.push(new WSItem(i))); this.values = tmpItems$; - } + }, + error: err => presentConnectionAlert(err, this.alertCtrl) + } )) } diff --git a/src/app/ws/ws.page.ts b/src/app/ws/ws.page.ts index f79ea57..639c8c9 100644 --- a/src/app/ws/ws.page.ts +++ b/src/app/ws/ws.page.ts @@ -1,11 +1,10 @@ import { Component, OnInit } from '@angular/core'; -import { Platform, AlertController, ToastController } from '@ionic/angular'; +import { AlertController} from '@ionic/angular'; import { Router, ActivatedRoute } from '@angular/router'; -import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { StoragehubService } from '../storagehub.service'; import { WSItem } from '../model/ws-item'; import { Item } from '../model/item.model'; -import { concatMap, from } from 'rxjs'; +import { presentConnectionAlert } from '../_helper/utils'; @Component({ selector: 'app-ws', @@ -25,7 +24,8 @@ export class WsPage implements OnInit { constructor(private storagehub: StoragehubService, private router: Router, - private route: ActivatedRoute) { } + private route: ActivatedRoute, + private alertCtrl: AlertController) { } ngOnInit() { var folderId: string | undefined = this.route.snapshot.paramMap.get('folderId') || undefined; @@ -36,19 +36,23 @@ export class WsPage implements OnInit { this.root = !folderId; if (!tmpItem) { if (!folderId) - this.storagehub.getWsRoot().then( (obs) => obs.subscribe( - (res) => { + this.storagehub.getWsRoot().then( (obs) => obs.subscribe({ + next: (res) => { this.item = new WSItem(res); this.onSuccess(res) - } - )); + }, + error: (err) => presentConnectionAlert(err, this.alertCtrl) + } + )) else //folder is not cached - this.storagehub.getItem(folderId).then( (obs) => obs.subscribe( - (res) => { + this.storagehub.getItem(folderId).then( (obs) => obs.subscribe({ + next: (res) => { this.item = new WSItem(res); this.onSuccess(res) - } - )); + }, + error: err => presentConnectionAlert(err, this.alertCtrl) + } + )) } else { this.item = tmpItem; this.onSuccess(tmpItem.item); @@ -58,13 +62,15 @@ export class WsPage implements OnInit { private onSuccess(item: Item) { - this.storagehub.getChildren(item.id, false).then( (obs) => obs.subscribe( - (res) => { + this.storagehub.getChildren(item.id, false).then( (obs) => obs.subscribe({ + next: (res) => { const tmpItems$: WSItem[] = [] res.forEach(i => tmpItems$.push(new WSItem(i))); this.values = tmpItems$; - } - )) + }, + error: (err) => presentConnectionAlert(err, this.alertCtrl), + }) + ) } public getValues(): WSItem[] | undefined { @@ -85,4 +91,5 @@ export class WsPage implements OnInit { getTitle() { return this.root ? "My Workspace" : this.item?.getTitle() } + }