Skip to content

Commit

Permalink
Merge branch 'main' into unit-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlundberg authored Sep 8, 2024
2 parents 2f77aa2 + 2890ff9 commit 4446f64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hooks/useModalCube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export default function useModalCube() {
const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false);
const [cubeData, setCubeData] = useState<DeleteCubeDetails | null>(null);

const defaultCubeId = loadSettings().preferences.defaultCube.cube?.id;

useEscape(() => setModalOpen(false));

const handleClickRadio = (category: Categories) => {
Expand Down Expand Up @@ -94,6 +92,7 @@ export default function useModalCube() {
}
}

const defaultCubeId = loadSettings().preferences.defaultCube.cube?.id;
if (editingCube.id === defaultCubeId) {
const currentSettings = loadSettings();
if (currentSettings.preferences.defaultCube.cube) {
Expand Down Expand Up @@ -168,7 +167,7 @@ export default function useModalCube() {
setNewScramble(null);
setTimerStatistics();
}

const defaultCubeId = loadSettings().preferences.defaultCube.cube?.id;
if (editingCube.id === defaultCubeId) {
const currentSettings = loadSettings();
currentSettings.preferences.defaultCube.cube = null;
Expand Down

0 comments on commit 4446f64

Please sign in to comment.