fixes + fixes for anon users

This commit is contained in:
Henry Jameson 2022-08-12 00:50:08 +03:00
parent 3a16a59f37
commit 0123872b56
8 changed files with 26 additions and 6 deletions

View File

@ -86,6 +86,7 @@
grid-template-columns: 2fr auto; grid-template-columns: 2fr auto;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
a { a {
color: var(--topBarLink, $fallback--link); color: var(--topBarLink, $fallback--link);
} }
@ -175,7 +176,6 @@
.pinned-item { .pinned-item {
flex-grow: 1; flex-grow: 1;
text-align: center;
} }
} }

View File

@ -86,6 +86,19 @@ const NavPanel = {
pinnedItems: state => new Set(state.serverSideStorage.prefsStorage.collections.pinnedNavItems), pinnedItems: state => new Set(state.serverSideStorage.prefsStorage.collections.pinnedNavItems),
collapsed: state => state.serverSideStorage.prefsStorage.simple.collapseNav collapsed: state => state.serverSideStorage.prefsStorage.simple.collapseNav
}), }),
timelinesItems () {
return filterNavigation(
Object
.entries({ ...TIMELINES })
.map(([k, v]) => ({ ...v, name: k })),
{
hasChats: this.pleromaChatMessagesAvailable,
isFederating: this.federating,
isPrivate: this.private,
currentUser: this.currentUser
}
)
},
rootItems () { rootItems () {
return filterNavigation( return filterNavigation(
Object Object

View File

@ -37,7 +37,7 @@
class="timelines-background" class="timelines-background"
> >
<ul class="timelines"> <ul class="timelines">
<NavigationEntry v-for="item in timelinesList" :key="item.name" :show-pin="true" :item="item" /> <NavigationEntry v-for="item in timelinesItems" :key="item.name" :show-pin="true" :item="item" />
</ul> </ul>
</div> </div>
</li> </li>

View File

@ -1,7 +1,6 @@
export const TIMELINES = { export const TIMELINES = {
home: { home: {
route: 'friends', route: 'friends',
anonRoute: 'public-timeline',
icon: 'home', icon: 'home',
label: 'nav.home_timeline', label: 'nav.home_timeline',
criteria: ['!private'] criteria: ['!private']

View File

@ -21,7 +21,7 @@
@click.stop.prevent="togglePin(item.name)" @click.stop.prevent="togglePin(item.name)"
> >
<FAIcon <FAIcon
v-if="showPin" v-if="showPin && currentUser"
fixed-width fixed-width
class="fa-scale-110" class="fa-scale-110"
:class="{ 'veryfaint': !isPinned(item.name) }" :class="{ 'veryfaint': !isPinned(item.name) }"

View File

@ -42,6 +42,13 @@ const NavPanel = {
pinnedItems: state => new Set(state.serverSideStorage.prefsStorage.collections.pinnedNavItems) pinnedItems: state => new Set(state.serverSideStorage.prefsStorage.collections.pinnedNavItems)
}), }),
pinnedList () { pinnedList () {
if (!this.currentUser) {
return [
{ ...TIMELINES.public, name: 'public' },
{ ...TIMELINES.twkn, name: 'twkn' },
{ ...ROOT_ITEMS.about, name: 'about' }
]
}
return filterNavigation( return filterNavigation(
[ [
...Object ...Object

View File

@ -46,6 +46,7 @@
position: relative; position: relative;
flex: 0 0 3em; flex: 0 0 3em;
min-width: 2em; min-width: 2em;
text-align: center;
& .svg-inline--fa, & .svg-inline--fa,
& .iconLetter { & .iconLetter {

View File

@ -116,7 +116,7 @@ describe('The serverSideStorage module', () => {
expect(state.prefsStorage._journal.length).to.eql(1) expect(state.prefsStorage._journal.length).to.eql(1)
expect(state.prefsStorage._journal[0]).to.eql({ expect(state.prefsStorage._journal[0]).to.eql({
path: 'simple.testing', path: 'simple.testing',
command: 'set', operation: 'set',
args: [1], args: [1],
// should have A timestamp, we don't really care what it is // should have A timestamp, we don't really care what it is
timestamp: state.prefsStorage._journal[0].timestamp timestamp: state.prefsStorage._journal[0].timestamp
@ -132,7 +132,7 @@ describe('The serverSideStorage module', () => {
expect(state.prefsStorage._journal.length).to.eql(1) expect(state.prefsStorage._journal.length).to.eql(1)
expect(state.prefsStorage._journal[0]).to.eql({ expect(state.prefsStorage._journal[0]).to.eql({
path: 'simple.testing', path: 'simple.testing',
command: 'set', operation: 'set',
args: [2], args: [2],
// should have A timestamp, we don't really care what it is // should have A timestamp, we don't really care what it is
timestamp: state.prefsStorage._journal[0].timestamp timestamp: state.prefsStorage._journal[0].timestamp