mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
don't be so fragile when comparing marketplace URLs (#2040)
* don't be so fragile when comparing marketplace URLs * handle more edges * minor * clean up a little
This commit is contained in:
@@ -9,7 +9,12 @@ import {
|
||||
AbstractMarketplaceService,
|
||||
MarketplacePkg,
|
||||
} from '@start9labs/marketplace'
|
||||
import { Emver, ErrorToastService, isEmptyObject } from '@start9labs/shared'
|
||||
import {
|
||||
Emver,
|
||||
ErrorToastService,
|
||||
isEmptyObject,
|
||||
sameUrl,
|
||||
} from '@start9labs/shared'
|
||||
import {
|
||||
DataModel,
|
||||
PackageDataEntry,
|
||||
@@ -71,7 +76,7 @@ export class MarketplaceShowControlsComponent {
|
||||
} else {
|
||||
const originalUrl = this.localPkg.installed?.['marketplace-url']
|
||||
|
||||
if (url !== originalUrl) {
|
||||
if (!sameUrl(url, originalUrl)) {
|
||||
const proceed = await this.presentAlertDifferentMarketplace(
|
||||
url,
|
||||
originalUrl,
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
MarketplacePkg,
|
||||
StoreIdentity,
|
||||
} from '@start9labs/marketplace'
|
||||
import { Emver, isEmptyObject } from '@start9labs/shared'
|
||||
import { Emver, isEmptyObject, sameUrl } from '@start9labs/shared'
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
import { combineLatest, Observable } from 'rxjs'
|
||||
import { PrimaryRendering } from '../../services/pkg-status-rendering.service'
|
||||
@@ -194,7 +194,8 @@ export function marketplaceSame(
|
||||
local: Record<string, PackageDataEntry>,
|
||||
url: string,
|
||||
): boolean {
|
||||
return local[id]?.installed?.['marketplace-url'] === url
|
||||
const localUrl = local[id]?.installed?.['marketplace-url']
|
||||
return sameUrl(localUrl, url)
|
||||
}
|
||||
|
||||
export function versionLower(
|
||||
|
||||
Reference in New Issue
Block a user