Skip to content

Commit 839c692

Browse files
authored
Merge pull request #1190 from xieliuduo/dev50-fixstory
refactor: isElView in story player
2 parents 92c593e + 3a20d79 commit 839c692

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

frontend/src/app/pages/DashBoardPage/pages/Board/slice/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ const boardSlice = createSlice({
210210
action: PayloadAction<{ boardId: string; wh: [number, number] }>,
211211
) {
212212
const { boardId, wh } = action.payload;
213-
state.boardInfoRecord[boardId].boardWidthHeight = wh;
213+
let boardInfo = state.boardInfoRecord?.[boardId];
214+
if (boardInfo) {
215+
state.boardInfoRecord[boardId].boardWidthHeight = wh;
216+
}
214217
},
215218
changeBoardPublish(
216219
state,

frontend/src/app/pages/DashBoardPage/utils/board.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export const isElView = el => {
220220
// bottom 元素底部端到可见区域顶端的距离
221221
var viewHeight = window.innerHeight || document.documentElement.clientHeight; // 浏览器可见区域高度。
222222

223-
if (top < viewHeight && bottom > 0) {
223+
if (top <= viewHeight && bottom >= 0) {
224224
bool = true;
225225
} else if (top >= viewHeight || bottom <= 0) {
226226
bool = false;

0 commit comments

Comments
 (0)