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-direction: column;
flex-grow: 1; flex-grow: 1;
color: #cccccc; color: #cccccc;
min-width: 0;
} }
.active { .active {

View File

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

View File

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

View File

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

View File

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

View File

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