Skip to content

Commit

Permalink
Fix positioning bug
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegWock committed Aug 10, 2023
1 parent 0a2222d commit 69196c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Anori",
"description": "Customizable new tab: compose your own page from widgets",
"version": "1.11.1",
"version": "1.11.2",
"repository": "git@github.com:OlegWock/anori.git",
"author": "OlegWock",
"license": "AGPL-3.0",
Expand Down
3 changes: 2 additions & 1 deletion src/pages/newtab/components/NewWidgetWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export const NewWidgetWizard = ({ onClose, folder, gridDimensions, layout }: New
console.log({ gridDimensions, layout });
let position = findPositionForItemInGrid({ grid: gridDimensions, layout, item: widget.appearance.size });
if (!position) {
const numberOfColumns = Math.max(...layout.map(w => w.x + w.width), 0);
position = {
x: gridDimensions.columns,
x: numberOfColumns,
y: 0,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/user-data/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const tryMoveWidgetToFolder = async (folderIdFrom: Folder["id"], folderId
const toFolderLayout = toFolderDetails.widgets;
let newPosition = findPositionForItemInGrid({ grid: currentGrid, layout: toFolderLayout, item: widgetInfo });
if (!newPosition) {
const numberOfColumns = Math.max(...toFolderLayout.map(w => w.x + w.width));
const numberOfColumns = Math.max(...toFolderLayout.map(w => w.x + w.width), 0);
newPosition = {
x: numberOfColumns,
y: 0,
Expand Down

0 comments on commit 69196c3

Please sign in to comment.