mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Fix/misc frontend (#2273)
* update pwa icon to official latest * fix bug if icon is null in assets * dismiss modal when connecting to a new registry
This commit is contained in:
@@ -6,19 +6,22 @@ import { MarketplacePkg } from '../types'
|
|||||||
})
|
})
|
||||||
export class MimeTypePipe implements PipeTransform {
|
export class MimeTypePipe implements PipeTransform {
|
||||||
transform(pkg: MarketplacePkg): string {
|
transform(pkg: MarketplacePkg): string {
|
||||||
switch (pkg.manifest.assets.icon.split('.').pop()) {
|
if (pkg.manifest.assets.icon) {
|
||||||
case 'png':
|
switch (pkg.manifest.assets.icon.split('.').pop()) {
|
||||||
return `data:image/png;base64,${pkg.icon}`
|
case 'png':
|
||||||
case 'jpeg':
|
return `data:image/png;base64,${pkg.icon}`
|
||||||
case 'jpg':
|
case 'jpeg':
|
||||||
return `data:image/jpeg;base64,${pkg.icon}`
|
case 'jpg':
|
||||||
case 'gif':
|
return `data:image/jpeg;base64,${pkg.icon}`
|
||||||
return `data:image/gif;base64,${pkg.icon}`
|
case 'gif':
|
||||||
case 'svg':
|
return `data:image/gif;base64,${pkg.icon}`
|
||||||
return `data:image/svg+xml;base64,${pkg.icon}`
|
case 'svg':
|
||||||
default:
|
return `data:image/svg+xml;base64,${pkg.icon}`
|
||||||
return `data:image/png;base64,${pkg.icon}`
|
default:
|
||||||
|
return `data:image/png;base64,${pkg.icon}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return `data:image/png;base64,${pkg.icon}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
frontend/projects/shared/assets/img/icon_pwa.png
Normal file
BIN
frontend/projects/shared/assets/img/icon_pwa.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB |
@@ -1,4 +1,9 @@
|
|||||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'
|
import {
|
||||||
|
ChangeDetectionStrategy,
|
||||||
|
Component,
|
||||||
|
Inject,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core'
|
||||||
import {
|
import {
|
||||||
ActionSheetController,
|
ActionSheetController,
|
||||||
AlertController,
|
AlertController,
|
||||||
@@ -6,12 +11,7 @@ import {
|
|||||||
ModalController,
|
ModalController,
|
||||||
} from '@ionic/angular'
|
} from '@ionic/angular'
|
||||||
import { ActionSheetButton } from '@ionic/core'
|
import { ActionSheetButton } from '@ionic/core'
|
||||||
import {
|
import { ErrorToastService, sameUrl, toUrl } from '@start9labs/shared'
|
||||||
ErrorToastService,
|
|
||||||
isValidHttpUrl,
|
|
||||||
sameUrl,
|
|
||||||
toUrl,
|
|
||||||
} from '@start9labs/shared'
|
|
||||||
import { AbstractMarketplaceService } from '@start9labs/marketplace'
|
import { AbstractMarketplaceService } from '@start9labs/marketplace'
|
||||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
import { ValueSpecObject } from 'src/app/pkg-config/config-types'
|
import { ValueSpecObject } from 'src/app/pkg-config/config-types'
|
||||||
@@ -162,6 +162,7 @@ export class MarketplaceSettingsPage {
|
|||||||
this.errToast.present(e)
|
this.errToast.present(e)
|
||||||
} finally {
|
} finally {
|
||||||
loader.dismiss()
|
loader.dismiss()
|
||||||
|
this.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,6 +190,7 @@ export class MarketplaceSettingsPage {
|
|||||||
this.errToast.present(e)
|
this.errToast.present(e)
|
||||||
} finally {
|
} finally {
|
||||||
loader.dismiss()
|
loader.dismiss()
|
||||||
|
this.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"id": "/",
|
"id": "/",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "assets/img/logo_solid.png",
|
"src": "assets/img/icon_pwa.png",
|
||||||
"sizes": "256x256",
|
"sizes": "256x256",
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"purpose": "any"
|
"purpose": "any"
|
||||||
|
|||||||
Reference in New Issue
Block a user