fix bug where closing the object view would scroll to the overview tab
This commit is contained in:
Vendored
+1
-1
@@ -60,7 +60,7 @@
|
|||||||
}
|
}
|
||||||
[showingobjects][chatvisible][chatopen] .thread-view {
|
[showingobjects][chatvisible][chatopen] .thread-view {
|
||||||
top: unset;
|
top: unset;
|
||||||
bottom: var(--control-height);
|
bottom: calc(var(--control-height) + var(--safe-area-bottom));
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: var(--split-thread-height);
|
height: var(--split-thread-height);
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
|||||||
Vendored
+7
-1
@@ -1331,6 +1331,9 @@
|
|||||||
[isShowingObjects, isShowingChatInSplit],
|
[isShowingObjects, isShowingChatInSplit],
|
||||||
() => isShowingObjects.value == false || isShowingChatInSplit.value == true
|
() => isShowingObjects.value == false || isShowingChatInSplit.value == true
|
||||||
);
|
);
|
||||||
|
isShowingObjects.subscribeSilent(() => {
|
||||||
|
setTimeout(() => scrollToChat("instant"), 1);
|
||||||
|
});
|
||||||
var newChatName = new State("");
|
var newChatName = new State("");
|
||||||
var cannotCreateChat = createProxyState(
|
var cannotCreateChat = createProxyState(
|
||||||
[newChatName],
|
[newChatName],
|
||||||
@@ -1348,7 +1351,10 @@
|
|||||||
function selectChat(chat) {
|
function selectChat(chat) {
|
||||||
selectedChat.value = chat;
|
selectedChat.value = chat;
|
||||||
chat.hasUnreadMessages.value = false;
|
chat.hasUnreadMessages.value = false;
|
||||||
document.getElementById("message-tab")?.scrollIntoView();
|
scrollToChat();
|
||||||
|
}
|
||||||
|
function scrollToChat(behavior = "smooth") {
|
||||||
|
document.getElementById("message-tab")?.scrollIntoView({ behavior });
|
||||||
}
|
}
|
||||||
function toggleObjects() {
|
function toggleObjects() {
|
||||||
isShowingObjects.value = !isShowingObjects.value;
|
isShowingObjects.value = !isShowingObjects.value;
|
||||||
|
|||||||
+8
-1
@@ -223,6 +223,9 @@ export const isChatVisible = React.createProxyState(
|
|||||||
[isShowingObjects, isShowingChatInSplit],
|
[isShowingObjects, isShowingChatInSplit],
|
||||||
() => isShowingObjects.value == false || isShowingChatInSplit.value == true
|
() => isShowingObjects.value == false || isShowingChatInSplit.value == true
|
||||||
);
|
);
|
||||||
|
isShowingObjects.subscribeSilent(() => {
|
||||||
|
setTimeout(() => scrollToChat("instant"), 1);
|
||||||
|
});
|
||||||
|
|
||||||
export const newChatName = new React.State("");
|
export const newChatName = new React.State("");
|
||||||
|
|
||||||
@@ -246,7 +249,11 @@ export function closeChatView() {
|
|||||||
export function selectChat(chat: Chat) {
|
export function selectChat(chat: Chat) {
|
||||||
selectedChat.value = chat;
|
selectedChat.value = chat;
|
||||||
chat.hasUnreadMessages.value = false;
|
chat.hasUnreadMessages.value = false;
|
||||||
document.getElementById("message-tab")?.scrollIntoView();
|
scrollToChat();
|
||||||
|
}
|
||||||
|
|
||||||
|
export function scrollToChat(behavior: ScrollBehavior = "smooth") {
|
||||||
|
document.getElementById("message-tab")?.scrollIntoView({ behavior });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toggleObjects() {
|
export function toggleObjects() {
|
||||||
|
|||||||
Reference in New Issue
Block a user