Skip to content

Commit

Permalink
add pubkey+kind idb index, no wait for window.onload
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Aug 20, 2023
1 parent b1bb537 commit c27400e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
5 changes: 1 addition & 4 deletions src/js/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ type ReactState = {

class Main extends Component<Props, ReactState> {
componentDidMount() {
window.onload = () => {
// this makes sure that window.nostr is there
localState.get('loggedIn').on(this.inject());
};
localState.get('loggedIn').on(this.inject());
// iris.electron && iris.electron.get('platform').on(this.inject());
localState.get('unseenMsgsTotal').on(this.inject());
translationLoaded.then(() => this.setState({ translationLoaded: true }));
Expand Down
4 changes: 2 additions & 2 deletions src/js/nostr/IndexedDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export class MyDexie extends Dexie {
constructor() {
super('iris');

this.version(4).stores({
events: 'id, pubkey, kind, created_at',
this.version(5).stores({
events: 'id, pubkey, kind, created_at, [pubkey+kind]',
tags: 'id, eventId, [type+value]',
});
}
Expand Down
17 changes: 10 additions & 7 deletions src/js/views/feeds/Global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import OnboardingNotification from '@/components/onboarding/OnboardingNotificati
import { getEventReplyingTo } from '@/nostr/utils';
import { translate as t } from '@/translations/Translation.mjs';
import { RouteProps } from '@/views/types.ts';
import View from '@/views/View.tsx';

const Global: React.FC<RouteProps> = () => {
const filterOptions = useMemo(
Expand All @@ -26,15 +27,17 @@ const Global: React.FC<RouteProps> = () => {
);

return (
<div className="flex flex-row">
<div className="flex flex-col w-full">
<OnboardingNotification />
<div className="hidden md:block px-4">
<CreateNoteForm autofocus={false} placeholder={t('whats_on_your_mind')} />
<View>
<div className="flex flex-row">
<div className="flex flex-col w-full">
<OnboardingNotification />
<div className="hidden md:block px-4">
<CreateNoteForm autofocus={false} placeholder={t('whats_on_your_mind')} />
</div>
<FeedComponent filterOptions={filterOptions} />
</div>
<FeedComponent filterOptions={filterOptions} />
</div>
</div>
</View>
);
};

Expand Down

0 comments on commit c27400e

Please sign in to comment.