Compare commits

...

11 Commits

Author SHA1 Message Date
CI
9f57bf46a1 chore: release version v1.0.17 2024-09-21 11:23:48 +00:00
Dmitry Popov
4ce47da521 chore: release version v1.0.16 2024-09-21 15:23:09 +04:00
CI
4dc6382402 chore: release version v1.0.16 2024-09-21 09:24:55 +00:00
Aleksei Chichenkov
cb8c1e32d9 Merge pull request #10 from wanderer-industries/fix-wnd-6
fix(Map): add key for cache changes detecting
2024-09-21 12:24:30 +03:00
achichenkov
bf534be128 fix(Map): commented console log
Fixes #6
2024-09-21 12:19:48 +03:00
CI
a89c117612 chore: release version v1.0.15 2024-09-21 09:16:33 +00:00
Dmitry Popov
501dbcd76b fix(map): Show a proper user notification if map was deleted/archived 2024-09-21 13:16:04 +04:00
achichenkov
c0ceff1eec fix(Map): add console log for check sys loading
Fixes #6
2024-09-21 11:47:19 +03:00
CI
6039ac5d4f chore: release version v1.0.14 2024-09-21 08:35:54 +00:00
Dmitry Popov
48e87f3c47 Create FUNDING.yml 2024-09-21 12:35:30 +04:00
achichenkov
c7866a1270 fix(Map): add key for cache changes detecting
Fixes #6
2024-09-21 11:26:25 +03:00
7 changed files with 132 additions and 4 deletions

15
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: WandererLtd
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -2,6 +2,38 @@
<!-- changelog -->
## [v1.0.17](https://github.com/wanderer-industries/wanderer/compare/v1.0.16...v1.0.17) (2024-09-21)
## [v1.0.16](https://github.com/wanderer-industries/wanderer/compare/v1.0.15...v1.0.16) (2024-09-21)
### Bug Fixes:
* Map: commented console log
* Map: add console log for check sys loading
* Map: add key for cache changes detecting
## [v1.0.15](https://github.com/wanderer-industries/wanderer/compare/v1.0.14...v1.0.15) (2024-09-21)
### Bug Fixes:
* map: Show a proper user notification if map was deleted/archived
## [v1.0.14](https://github.com/wanderer-industries/wanderer/compare/v1.0.13...v1.0.14) (2024-09-21)
## [v1.0.13](https://github.com/wanderer-industries/wanderer/compare/v1.0.12...v1.0.13) (2024-09-21)

View File

@@ -38,7 +38,7 @@ export const RoutesWidgetContent = () => {
const { loading } = useLoadRoutes();
const { systems: systemStatics, loadSystems } = useLoadSystemStatic({ systems: hubs ?? [] });
const { systems: systemStatics, loadSystems, lastUpdateKey } = useLoadSystemStatic({ systems: hubs ?? [] });
const { open, ...systemCtxProps } = useContextMenuSystemInfoHandlers({
outCommand,
hubs,
@@ -51,7 +51,8 @@ export const RoutesWidgetContent = () => {
return { ...systemStatics.get(parseInt(x))!, ...(sys && { customName: sys.name ?? '' }) };
});
}, [hubs, systems, systemStatics]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [hubs, systems, systemStatics, lastUpdateKey]);
const preparedRoutes = useMemo(() => {
return (
@@ -114,6 +115,10 @@ export const RoutesWidgetContent = () => {
{preparedRoutes.map(route => {
const sys = preparedHubs.find(x => x.solar_system_id === route.destination)!;
// TODO do not delte this console log
// eslint-disable-next-line no-console
// console.log('JOipP', `Check sys [${route.destination}]:`, sys);
return (
<>
<div className="flex gap-2 items-center">

View File

@@ -27,12 +27,14 @@ interface UseLoadSystemStaticProps {
export const useLoadSystemStatic = ({ systems }: UseLoadSystemStaticProps) => {
const { outCommand } = useMapRootState();
const [loading, setLoading] = useState(false);
const [lastUpdateKey, setLastUpdateKey] = useState(0);
const ref = useRef({ outCommand });
ref.current = { outCommand };
const addSystemStatic = useCallback((static_info: SolarSystemStaticInfoRaw) => {
cache.set(static_info.solar_system_id, static_info);
setLastUpdateKey(new Date().getTime());
}, []);
const loadSystems = useCallback(async (systems: (number | string)[]) => {
@@ -43,6 +45,7 @@ export const useLoadSystemStatic = ({ systems }: UseLoadSystemStaticProps) => {
if (toLoad.length > 0) {
const res = await loadSystemStaticInfo(ref.current.outCommand, toLoad);
res.forEach(x => cache.set(x.solar_system_id, x));
setLastUpdateKey(new Date().getTime());
}
setLoading(false);
}, []);
@@ -52,5 +55,5 @@ export const useLoadSystemStatic = ({ systems }: UseLoadSystemStaticProps) => {
// eslint-disable-next-line
}, [systems]);
return { addSystemStatic, systems: cache, loading, loadSystems };
return { addSystemStatic, systems: cache, lastUpdateKey, loading, loadSystems };
};

61
flake.lock generated Normal file
View File

@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1726871744,
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -64,6 +64,18 @@ defmodule WandererAppWeb.MapLive do
timeout: 2000
})
{:ok,
%{
deleted: true
} = map} ->
socket
|> put_flash(
:error,
"Map was deleted by owner or administrator."
)
|> push_navigate(to: ~p"/maps")
{:error, _} ->
socket
|> put_flash(

View File

@@ -2,7 +2,7 @@ defmodule WandererApp.MixProject do
use Mix.Project
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.0.13"
@version "1.0.17"
def project do
[