mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-26 06:46:40 +00:00
add min version to product updates
This commit is contained in:
@@ -41,7 +41,10 @@ export default function ProductUpdates({
|
|||||||
|
|
||||||
const data = useQueries({
|
const data = useQueries({
|
||||||
queries: [
|
queries: [
|
||||||
productUpdatesQueries.list(env.app.notifications.product_updates),
|
productUpdatesQueries.list(
|
||||||
|
env.app.notifications.product_updates,
|
||||||
|
env.app.version
|
||||||
|
),
|
||||||
productUpdatesQueries.latestVersion(
|
productUpdatesQueries.latestVersion(
|
||||||
env.app.notifications.new_releases
|
env.app.notifications.new_releases
|
||||||
)
|
)
|
||||||
@@ -78,10 +81,10 @@ export default function ProductUpdates({
|
|||||||
|
|
||||||
const showNewVersionPopup = Boolean(
|
const showNewVersionPopup = Boolean(
|
||||||
latestVersion &&
|
latestVersion &&
|
||||||
valid(latestVersion) &&
|
valid(latestVersion) &&
|
||||||
valid(currentVersion) &&
|
valid(currentVersion) &&
|
||||||
ignoredVersionUpdate !== latestVersion &&
|
ignoredVersionUpdate !== latestVersion &&
|
||||||
gt(latestVersion, currentVersion)
|
gt(latestVersion, currentVersion)
|
||||||
);
|
);
|
||||||
|
|
||||||
const filteredUpdates = data.updates.filter(
|
const filteredUpdates = data.updates.filter(
|
||||||
|
|||||||
@@ -41,12 +41,13 @@ export type LatestVersionResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const productUpdatesQueries = {
|
export const productUpdatesQueries = {
|
||||||
list: (enabled: boolean) =>
|
list: (enabled: boolean, version?: string) =>
|
||||||
queryOptions({
|
queryOptions({
|
||||||
queryKey: ["PRODUCT_UPDATES"] as const,
|
queryKey: ["PRODUCT_UPDATES"] as const,
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const sp = new URLSearchParams({
|
const sp = new URLSearchParams({
|
||||||
build
|
build,
|
||||||
|
...(version ? { version } : {})
|
||||||
});
|
});
|
||||||
const data = await remote.get<ResponseT<ProductUpdate[]>>(
|
const data = await remote.get<ResponseT<ProductUpdate[]>>(
|
||||||
`/product-updates?${sp.toString()}`,
|
`/product-updates?${sp.toString()}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user