fix issue seen in safari where topic list bounces

This commit is contained in:
Roland Osborne 2022-09-06 12:51:21 -07:00
parent 1608d20255
commit 5e5b3ab5d4
6 changed files with 11 additions and 6 deletions

View File

@ -31,6 +31,7 @@ export const AccountItemWrapper = styled.div`
flex-direction: column;
flex-grow: 1;
color: #cccccc;
min-width: 0;
}
.active {

View File

@ -125,7 +125,7 @@ export function useChannels() {
subject = names.join(", ");
}
if (!subject && !chan.contacts?.length) {
subject = "notes";
subject = "Notes";
}
chan.subject = subject;

View File

@ -85,7 +85,7 @@ export function useConversation(cardId, channelId) {
if (chan) {
if (!chan.contacts?.length) {
image = 'solution';
subject = 'Private';
subject = 'Notes';
}
else if (chan.contacts.length > 1) {
image = 'appstore'

View File

@ -90,7 +90,7 @@ export function VirtualList({ id, items, itemRenderer, loadMore }) {
};
const latchSlots = () => {
if (containers.current.length > 0 && latched.current) {
if (containers.current.length > 0 && latched.current && state.listHeight > 0) {
if (!nolatch.current) {
const last = containers.current[containers.current.length - 1];
const bottom = last.top + last.height;
@ -172,6 +172,10 @@ export function VirtualList({ id, items, itemRenderer, loadMore }) {
const loadSlots = () => {
if (state.listHeight == 0) {
return;
}
if (containers.current.length === 0) {
// add the first slot
if (itemView.current.length > 0) {

View File

@ -4,7 +4,7 @@ export function useVirtualList(id) {
const [state, setState] = useState({
view: null,
listHeight: 128,
listHeight: 0,
slots: [],
});

View File

@ -50,7 +50,7 @@ export function useDetails(cardId, channelId) {
if (chan) {
if (chan.contacts?.length === 0) {
img = 'solution';
subject = 'Private';
subject = 'Notes';
}
else if (chan.contacts?.length > 1) {
img = 'appstore'
@ -58,7 +58,7 @@ export function useDetails(cardId, channelId) {
}
else {
img = 'team';
subject = 'Direct'
subject = 'Conversation'
}
const parsed = JSON.parse(chan.data.channelDetail.data);
if (parsed.subject) {