Reload wallet assets after a physical delivery request.
The kashkool balance updates with the same assets refresh as the other user apps.
This commit is contained in:
@@ -8,6 +8,7 @@ import { tableAddress } from '@/api/address'
|
||||
import type { CountPInventory, PInventory } from '@/models/products'
|
||||
import type { Address } from '@/models/address'
|
||||
import { loading } from '@/utils'
|
||||
import { useWalletAssets } from '@/composables/useWalletAssets'
|
||||
import { usePhysicalReceiveShellContext } from './usePhysicalReceiveShell'
|
||||
|
||||
export interface NewPhysicalRequestContext {
|
||||
@@ -31,6 +32,7 @@ export const NEW_PHYSICAL_REQUEST_KEY: InjectionKey<NewPhysicalRequestContext> =
|
||||
|
||||
export function useNewPhysicalRequestPage() {
|
||||
const { isDesktop } = usePhysicalReceiveShellContext()
|
||||
const { loadWalletAssets } = useWalletAssets()
|
||||
|
||||
const items = ref<PInventory[]>()
|
||||
const baseItems = ref<PInventory[]>()
|
||||
@@ -122,6 +124,7 @@ export function useNewPhysicalRequestPage() {
|
||||
await nextTick()
|
||||
|
||||
message.success('درخواست شما با موفقیت ارسال شد')
|
||||
await loadWalletAssets(true)
|
||||
await initProductWallet()
|
||||
await router.push({ name: 'list' })
|
||||
} catch (e) {
|
||||
|
||||
@@ -190,7 +190,13 @@ function onTvBoard() {
|
||||
}
|
||||
|
||||
function scheduleCatalogRefreshFromStream() {
|
||||
if (onTvBoard()) return
|
||||
if (priceStreamLifecycle.value === 'open' || !shouldUsePricePolling() || onTvBoard()) {
|
||||
if (catalogStreamRefreshTimer) {
|
||||
clearTimeout(catalogStreamRefreshTimer)
|
||||
catalogStreamRefreshTimer = undefined
|
||||
}
|
||||
return
|
||||
}
|
||||
if (catalogStreamRefreshTimer) {
|
||||
clearTimeout(catalogStreamRefreshTimer)
|
||||
}
|
||||
@@ -222,6 +228,9 @@ function applySocketProductList(incoming: Product[], current?: Product[]) {
|
||||
}
|
||||
|
||||
export async function refreshProductsPageData() {
|
||||
if (priceStreamLifecycle.value === 'open' || !shouldUsePricePolling()) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const fresh = await getProductsCatalog(true)
|
||||
if (!fresh?.length) return
|
||||
|
||||
Reference in New Issue
Block a user