Skip to content

Commit bf56409

Browse files
authored
Merge pull request #979 from synonymdev/fix/various-fixes
fix: various fixes
2 parents daacbfd + 0852916 commit bf56409

File tree

6 files changed

+19
-25
lines changed

6 files changed

+19
-25
lines changed

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
'security',
2323
'send',
2424
'settings',
25+
'slashpay',
2526
'suggestions',
2627
'tokens',
2728
'transfer',

src/screens/Profile/Profile.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,8 @@ import { ProfileIntro, OfflinePayments } from './ProfileOnboarding';
4848
import type { RootStackScreenProps } from '../../navigation/types';
4949

5050
const Profile = memo((props: RootStackScreenProps<'Profile'>): ReactElement => {
51-
const { url } = useSelectedSlashtag();
52-
const { profile } = useProfile(url);
5351
const onboardingProfileStep = useSelector(onboardingProfileStepSelector);
5452

55-
// TEMP: remove after full backups are working
56-
// skip onboarding if we have a profile already
57-
if (profile.name) {
58-
return <ProfileScreen {...props} />;
59-
}
60-
6153
switch (onboardingProfileStep) {
6254
case 'Intro':
6355
return <ProfileIntro {...props} />;

src/screens/Profile/ProfileEdit.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,37 @@ import { PlusIcon } from '../../styles/icons';
99
import NavigationHeader from '../../components/NavigationHeader';
1010
import Button from '../../components/Button';
1111
import SafeAreaInsets from '../../components/SafeAreaInsets';
12-
import { useProfile, useSelectedSlashtag } from '../../hooks/slashtags';
1312
import ProfileCard from '../../components/ProfileCard';
1413
import ProfileLinks from '../../components/ProfileLinks';
14+
import Divider from '../../components/Divider';
15+
import useKeyboard from '../../hooks/keyboard';
16+
import { useProfile, useSelectedSlashtag } from '../../hooks/slashtags';
1517
import {
1618
setLinks,
1719
setOnboardingProfileStep,
1820
} from '../../store/actions/slashtags';
19-
import Store from '../../store/types';
21+
import { removeTodo } from '../../store/actions/todos';
2022
import { BasicProfile } from '../../store/types/slashtags';
23+
import { slashtagsLinksSelector } from '../../store/reselect/slashtags';
24+
import { onboardingProfileStepSelector } from '../../store/reselect/slashtags';
25+
import { arraysMatch } from '../../utils/helpers';
2126
import { saveProfile } from '../../utils/slashtags';
2227
import type { RootStackScreenProps } from '../../navigation/types';
23-
import { arraysMatch } from '../../utils/helpers';
24-
import Divider from '../../components/Divider';
25-
import { removeTodo } from '../../store/actions/todos';
26-
import useKeyboard from '../../hooks/keyboard';
2728

2829
export const ProfileEdit = ({
2930
navigation,
3031
}: RootStackScreenProps<'Profile' | 'ProfileEdit'>): JSX.Element => {
3132
const { t } = useTranslation('slashtags');
32-
const [fields, setFields] = useState<Omit<BasicProfile, 'links'>>({});
33-
const links = useSelector((state: Store) => state.slashtags.links);
34-
const [hasEdited, setHasEdited] = useState(false);
3533
const { keyboardShown } = useKeyboard();
34+
const [hasEdited, setHasEdited] = useState(false);
35+
const [fields, setFields] = useState<Omit<BasicProfile, 'links'>>({});
36+
const links = useSelector(slashtagsLinksSelector);
37+
const onboardingStep = useSelector(onboardingProfileStepSelector);
3638

3739
const { url, slashtag } = useSelectedSlashtag();
3840
const { profile: savedProfile } = useProfile(url);
3941

40-
// TODO: after full backup, onboarding step should be set to DONE
41-
// for now, we check if there is a savedProfile as a sign of onboarding done.
42-
const onboardedProfile =
43-
useSelector((state: Store) => state.slashtags.onboardingProfileStep) ===
44-
'Done' || !!savedProfile;
42+
const onboardedProfile = onboardingStep === 'Done';
4543

4644
const buttonContainerStyles = useMemo(
4745
() => ({

src/screens/Wallets/Send/ReviewAndSend.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,9 @@ const ReviewAndSend = ({
515515
warnings.push('dialog4');
516516
}
517517

518-
// Check if the user is setting the minimum relay fee given the current fee environment.
518+
// Check if the user is setting the minimum fee given the current fee environment.
519519
if (
520+
!transaction.lightningInvoice &&
520521
transaction.satsPerByte &&
521522
// This check is to prevent situations where all values are set to 1sat/vbyte. Where setting 1sat/vbyte is perfectly fine.
522523
feeEstimates.minimum < feeEstimates.slow &&

src/utils/lightning/logs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const listLogs = async (path: string, limit: number): Promise<string[]> => {
7171
//Newest first
7272
list.sort((a, b) => {
7373
return (
74-
(a.mtime ?? new Date()).getTime() - (b.mtime ?? new Date()).getTime()
74+
(b.mtime ?? new Date()).getTime() - (a.mtime ?? new Date()).getTime()
7575
);
7676
});
7777

src/utils/slashtags/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
getSelectedNetwork,
1515
getSelectedWallet,
1616
} from '../wallet';
17-
import { decodeLightningInvoice } from '../lightning';
17+
import { decodeLightningInvoice, waitForLdk } from '../lightning';
1818
import { createLightningInvoice } from '../../store/actions/lightning';
1919
import { getSettingsStore } from '../../store/helpers';
2020
import { TAvailableNetworks } from '../networks';
@@ -188,6 +188,8 @@ export const updateSlashPayConfig = debounce(
188188
const payConfig: SlashPayConfig =
189189
(await drive.get('/slashpay.json').then(decodeJSON).catch(noop)) || [];
190190

191+
await waitForLdk();
192+
191193
const { currentLightningNode } = getCurrentWallet({
192194
selectedWallet,
193195
selectedNetwork,

0 commit comments

Comments
 (0)