Skip to content

Commit

Permalink
Merge pull request #356 from scottbenton/fix/minor-fixes
Browse files Browse the repository at this point in the history
Fix/minor fixes
  • Loading branch information
scottbenton authored Jan 29, 2024
2 parents 9c896d9 + 2a038f1 commit eb01afb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Fixed cursor issue on the notes page with mobile Safari
- Fixed a performance issue that made switching tabs super slow
- Fixed a few crashes that could occur when switching pages after the application updated in the background
- Fixed an issue on the sectors page where saving would cause users to be kicked from the notes box

## 2.2.0

Expand Down
21 changes: 15 additions & 6 deletions src/components/features/worlds/SectorSection/OpenSector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { NPCItem } from "../NPCSection/NPCItem";
import { DebouncedOracleInput } from "components/shared/DebouncedOracleInput";
import DeleteIcon from "@mui/icons-material/Delete";
import { useConfirm } from "material-ui-confirm";
import { useCallback } from "react";

interface OpenSectorProps {
sectorId: string;
Expand Down Expand Up @@ -212,6 +213,18 @@ export function OpenSector(props: OpenSectorProps) {
(store) => store.worlds.currentWorld.currentWorldNPCs.setOpenNPCId
);

const noteSaveCallback = useCallback(
(sectorId: string, notes: Uint8Array, isBeaconRequest?: boolean) =>
updateNotes(sectorId, notes, false, isBeaconRequest),
[updateNotes]
);

const gmNoteSaveCallback = useCallback(
(sectorId: string, notes: Uint8Array, isBeaconRequest?: boolean) =>
updateNotes(sectorId, notes, true, isBeaconRequest),
[updateNotes]
);

if (!sector) {
return null;
}
Expand Down Expand Up @@ -340,9 +353,7 @@ export function OpenSector(props: OpenSectorProps) {
id={sectorId}
roomPrefix={`sector-private-${worldId}-`}
documentPassword={sectorId}
onSave={(sectorId, notes, isBeaconRequest) =>
updateNotes(sectorId, notes, true, isBeaconRequest)
}
onSave={gmNoteSaveCallback}
initialValue={gmNotes}
/>
</Grid>
Expand All @@ -359,9 +370,7 @@ export function OpenSector(props: OpenSectorProps) {
id={sectorId}
roomPrefix={`sector-public-${worldId}-`}
documentPassword={sectorId}
onSave={(sectorId, notes, isBeaconRequest) =>
updateNotes(sectorId, notes, false, isBeaconRequest)
}
onSave={noteSaveCallback}
initialValue={notes}
/>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home/Licensing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function Licensing() {
<>
This work is based on{" "}
<a href={"https://www.ironswornrpg.com"}>Ironsworn: Starforged</a>,
created by Shawn Tompkin, and licensed for our use under the{" "}
created by Shawn Tomkin, and licensed for our use under the{" "}
<a href={"https://creativecommons.org/licenses/by-nc-sa/4.0/"}>
Creative Commons Attribution-NonCommercial-ShareAlike 4.0
International license.
Expand Down

0 comments on commit eb01afb

Please sign in to comment.