MOBILE-2314 fileuploader: Lazy load modal
parent
d91f2ed51a
commit
4013855ae9
|
@ -12,10 +12,13 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreFileUploaderAudioRecorderComponent } from './audio-recorder/audio-recorder.component';
|
import { NgModule } from '@angular/core';
|
||||||
import { CoreFileUploaderAudioHistogramComponent } from './audio-histogram/audio-histogram';
|
import { CoreFileUploaderAudioHistogramComponent } from '@features/fileuploader/components/audio-histogram/audio-histogram';
|
||||||
|
|
||||||
|
import { CoreFileUploaderAudioRecorderComponent } from './audio-recorder.component';
|
||||||
|
|
||||||
|
export { CoreFileUploaderAudioRecorderComponent };
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -25,9 +28,5 @@ import { CoreFileUploaderAudioHistogramComponent } from './audio-histogram/audio
|
||||||
CoreFileUploaderAudioRecorderComponent,
|
CoreFileUploaderAudioRecorderComponent,
|
||||||
CoreFileUploaderAudioHistogramComponent,
|
CoreFileUploaderAudioHistogramComponent,
|
||||||
],
|
],
|
||||||
exports: [
|
|
||||||
CoreFileUploaderAudioRecorderComponent,
|
|
||||||
CoreFileUploaderAudioHistogramComponent,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class CoreFileUploaderComponentsModule {}
|
export class CoreFileUploaderAudioRecorderComponentModule {}
|
|
@ -13,7 +13,6 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { APP_INITIALIZER, NgModule, Type } from '@angular/core';
|
import { APP_INITIALIZER, NgModule, Type } from '@angular/core';
|
||||||
import { CoreFileUploaderComponentsModule } from '@features/fileuploader/components/components.module';
|
|
||||||
|
|
||||||
import { CoreFileUploaderProvider } from './services/fileuploader';
|
import { CoreFileUploaderProvider } from './services/fileuploader';
|
||||||
import { CoreFileUploaderDelegate, CoreFileUploaderDelegateService } from './services/fileuploader-delegate';
|
import { CoreFileUploaderDelegate, CoreFileUploaderDelegateService } from './services/fileuploader-delegate';
|
||||||
|
@ -31,9 +30,6 @@ export const CORE_FILEUPLOADER_SERVICES: Type<unknown>[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
|
||||||
CoreFileUploaderComponentsModule,
|
|
||||||
],
|
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: APP_INITIALIZER,
|
provide: APP_INITIALIZER,
|
||||||
|
|
|
@ -32,7 +32,6 @@ import { CoreSite } from '@classes/site';
|
||||||
import { CoreFileEntry, CoreFileHelper } from '@services/file-helper';
|
import { CoreFileEntry, CoreFileHelper } from '@services/file-helper';
|
||||||
import { CorePath } from '@singletons/path';
|
import { CorePath } from '@singletons/path';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreFileUploaderAudioRecorderComponent } from '@features/fileuploader/components/audio-recorder/audio-recorder.component';
|
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -159,6 +158,9 @@ export class CoreFileUploaderProvider {
|
||||||
* @returns Promise resolved with the file.
|
* @returns Promise resolved with the file.
|
||||||
*/
|
*/
|
||||||
async captureAudioInApp(): Promise<CoreFileUploaderAudioRecording> {
|
async captureAudioInApp(): Promise<CoreFileUploaderAudioRecording> {
|
||||||
|
const { CoreFileUploaderAudioRecorderComponent } =
|
||||||
|
await import('@features/fileuploader/components/audio-recorder/audio-recorder.module');
|
||||||
|
|
||||||
const recording = await CoreModals.openSheet(CoreFileUploaderAudioRecorderComponent);
|
const recording = await CoreModals.openSheet(CoreFileUploaderAudioRecorderComponent);
|
||||||
|
|
||||||
if (!recording) {
|
if (!recording) {
|
||||||
|
|
Loading…
Reference in New Issue