Skip to content

Commit

Permalink
Merge pull request #620 from cheeaun/main
Browse files Browse the repository at this point in the history
Update from main
  • Loading branch information
cheeaun authored Aug 11, 2024
2 parents dabb480 + 3f23fe6 commit 16248c4
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 13 deletions.
8 changes: 7 additions & 1 deletion src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,7 @@ ul.link-list li a .icon {
/* COLUMNS */

#columns {
--column-size: 360px;
display: flex;
width: 100vw;
overflow-y: hidden;
Expand All @@ -2412,6 +2413,11 @@ ul.link-list li a .icon {
overscroll-behavior-x: contain;
/* This `transform` fixes horizontal scrolling for pointer devices on iPad */
transform: translateZ(0);

/* 360px * 2 */
@media (min-width: 720px) {
scroll-snap-type: none;
}
}
/* #columns::-webkit-scrollbar {
display: none;
Expand All @@ -2421,7 +2427,7 @@ ul.link-list li a .icon {
scroll-snap-align: start;
scroll-snap-stop: always;
overscroll-behavior: auto;
flex-basis: min(100vw, 360px);
flex-basis: min(100vw, var(--column-size));
flex-shrink: 0;
box-shadow: -1px 0 var(--bg-color), -2px 0 var(--drop-shadow-color),
-3px 0 var(--bg-color);
Expand Down
26 changes: 19 additions & 7 deletions src/components/compose.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,14 @@ function Compose({
focusTextarea();
setVisibility(
visibility === 'public' && prefs['posting:default:visibility']
? prefs['posting:default:visibility']
? prefs['posting:default:visibility'].toLowerCase()
: visibility,
);
setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);
setLanguage(
language ||
prefs['posting:default:language']?.toLowerCase() ||
DEFAULT_LANG,
);
setSensitive(sensitive && !!spoilerText);
} else if (editStatus) {
const { visibility, language, sensitive, poll, mediaAttachments } =
Expand All @@ -316,7 +320,11 @@ function Compose({
focusTextarea();
spoilerTextRef.current.value = spoilerText;
setVisibility(visibility);
setLanguage(language || presf.postingDefaultLanguage || DEFAULT_LANG);
setLanguage(
language ||
prefs['posting:default:language']?.toLowerCase() ||
DEFAULT_LANG,
);
setSensitive(sensitive);
if (composablePoll) setPoll(composablePoll);
setMediaAttachments(mediaAttachments);
Expand All @@ -331,13 +339,13 @@ function Compose({
focusTextarea();
console.log('Apply prefs', prefs);
if (prefs['posting:default:visibility']) {
setVisibility(prefs['posting:default:visibility']);
setVisibility(prefs['posting:default:visibility'].toLowerCase());
}
if (prefs['posting:default:language']) {
setLanguage(prefs['posting:default:language']);
setLanguage(prefs['posting:default:language'].toLowerCase());
}
if (prefs['posting:default:sensitive']) {
setSensitive(prefs['posting:default:sensitive']);
setSensitive(!!prefs['posting:default:sensitive']);
}
}
if (draftStatus) {
Expand All @@ -360,7 +368,11 @@ function Compose({
focusTextarea();
if (spoilerText) spoilerTextRef.current.value = spoilerText;
if (visibility) setVisibility(visibility);
setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);
setLanguage(
language ||
prefs['posting:default:language']?.toLowerCase() ||
DEFAULT_LANG,
);
if (sensitive !== null) setSensitive(sensitive);
if (composablePoll) setPoll(composablePoll);
if (mediaAttachments) setMediaAttachments(mediaAttachments);
Expand Down
2 changes: 1 addition & 1 deletion src/components/media-post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function MediaPost({
const readingExpandMedia = useMemo(() => {
// default | show_all | hide_all
const prefs = store.account.get('preferences') || {};
return prefs['reading:expand:media'] || 'default';
return prefs['reading:expand:media']?.toLowerCase() || 'default';
}, []);
const showSpoilerMedia = readingExpandMedia === 'show_all';

Expand Down
2 changes: 1 addition & 1 deletion src/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function Status({
// default | show_all | hide_all
// Ignore hide_all because it means hide *ALL* media including non-sensitive ones
const prefs = store.account.get('preferences') || {};
return prefs['reading:expand:media'] || 'default';
return prefs['reading:expand:media']?.toLowerCase() || 'default';
}, []);
// FOR TESTING:
// const readingExpandSpoilers = true;
Expand Down
32 changes: 31 additions & 1 deletion src/data/status-supported-languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@
"Malay",
"Bahasa Melayu"
],
[
"ms-Arab",
"Jawi Malay",
"بهاس ملايو"
],
[
"mt",
"Maltese",
Expand Down Expand Up @@ -626,7 +631,7 @@
],
[
"pa",
"Panjabi",
"Punjabi",
"ਪੰਜਾਬੀ"
],
[
Expand Down Expand Up @@ -949,6 +954,11 @@
"Montenegrin",
"crnogorski"
],
[
"csb",
"Kashubian",
"Kaszëbsczi"
],
[
"jbo",
"Lojban",
Expand All @@ -969,6 +979,21 @@
"Lingua Franca Nova",
"lingua franca nova"
],
[
"moh",
"Mohawk",
"Kanienʼkéha"
],
[
"nds",
"Low German",
"Plattdüütsch"
],
[
"pdc",
"Pennsylvania Dutch",
"Pennsilfaani-Deitsch"
],
[
"sco",
"Scots",
Expand All @@ -994,6 +1019,11 @@
"Toki Pona",
"toki pona"
],
[
"vai",
"Vai",
"ꕙꔤ"
],
[
"xal",
"Kalmyk",
Expand Down
1 change: 1 addition & 0 deletions src/pages/catchup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,7 @@ function Catchup() {
setSelectedFilterCategory(label);
if (label === 'Boosts') {
setSortBy('reblogsCount');
setSortOrder('desc');
setGroupBy(null);
}
// setSelectedAuthor(null);
Expand Down
5 changes: 3 additions & 2 deletions src/utils/is-rtl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ let IS_RTL = false;
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'attributes') {
const { value } = mutation.target;
if (value === 'rtl') {
const { dir } = mutation.target;
if (dir === 'rtl') {
IS_RTL = true;
} else {
IS_RTL = false;
}
console.log({ IS_RTL });
// Fire custom event 'dirchange' on document
// document.dispatchEvent(new Event('dirchange'));
}
Expand Down

0 comments on commit 16248c4

Please sign in to comment.