Compare commits

..

9 Commits

Author SHA1 Message Date
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
6 changed files with 68 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,33 @@
<!-- changelog -->
## [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 };
};

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(
@@ -1589,6 +1601,7 @@ defmodule WandererAppWeb.MapLive do
:character_eve_id,
:name,
:description,
:custom_info,
:kind,
:group,
:updated_at
@@ -1796,6 +1809,7 @@ defmodule WandererAppWeb.MapLive do
eve_id: eve_id,
name: name,
description: Map.get(signature, "description"),
custom_info: Map.get(signature, "custom_info"),
kind: kind,
group: group,
character_eve_id: character_eve_id

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.16"
def project do
[