feat: hide Olympus upload option for bolt DB channel export

This commit is contained in:
Shubham Kumar
2026-04-01 14:17:50 +05:30
parent 78dcfd2841
commit 34695ec41b
2 changed files with 138 additions and 74 deletions
+69 -37
View File
@@ -219,48 +219,80 @@ export default class Seed extends React.PureComponent<SeedProps, SeedState> {
const pubkey = NodeInfoStore.nodeInfo.identity_pubkey;
const lndDir = () => this.props.SettingsStore.lndDir || 'lnd';
const seedPhrase = SettingsStore.seedPhrase.join(' ');
const isSqlite = SettingsStore.isSqlite;
Alert.alert(
localeString('views.Tools.migration.export.title'),
const setStatus = (msg: string | null) =>
this.setState({
isChannelExporting: msg !== null,
channelExportMessage: msg ?? ''
});
const warningText =
`${localeString('views.Tools.migration.export.text1')}\n\n` +
`⚠️ ${localeString('views.Tools.migration.export.text2')}`,
[
{
text: localeString('general.cancel'),
style: 'cancel'
},
{
text: localeString('views.Tools.migration.export.olympus'),
style: 'default',
onPress: async () => {
await uploadChannelBackupToOlympus(
lndDir(),
isTestnet,
pubkey,
seedPhrase,
(msg) =>
this.setState({
isChannelExporting: msg !== null,
channelExportMessage: msg ?? ''
})
);
`⚠️ ${localeString('views.Tools.migration.export.text2')}`;
if (isSqlite) {
Alert.alert(
localeString('views.Tools.migration.export.title'),
warningText,
[
{
text: localeString('general.cancel'),
style: 'cancel'
},
{
text: localeString(
'views.Tools.migration.export.olympus'
),
style: 'default',
onPress: async () => {
await uploadChannelBackupToOlympus(
lndDir(),
isTestnet,
pubkey,
seedPhrase,
setStatus
);
}
},
{
text: localeString(
'views.Tools.migration.export.local'
),
style: 'default',
onPress: async () => {
await exportChannelDb(
lndDir(),
isTestnet,
setStatus
);
}
}
},
{
text: localeString('views.Tools.migration.export.local'),
style: 'default',
onPress: async () => {
await exportChannelDb(lndDir(), isTestnet, (msg) =>
this.setState({
isChannelExporting: msg !== null,
channelExportMessage: msg ?? ''
})
);
]
);
} else {
Alert.alert(
localeString('views.Tools.migration.export.title'),
warningText,
[
{
text: localeString('general.cancel'),
style: 'cancel'
},
{
text: localeString('general.ok'),
style: 'default',
onPress: async () => {
await exportChannelDb(
lndDir(),
isTestnet,
setStatus
);
}
}
}
]
);
]
);
}
};
render() {
+69 -37
View File
@@ -136,48 +136,80 @@ export default class Tools extends React.Component<ToolsProps, ToolsState> {
const pubkey = NodeInfoStore.nodeInfo.identity_pubkey;
const lndDir = () => SettingsStore.lndDir || 'lnd';
const seedPhrase = SettingsStore.seedPhrase.join(' ');
const isSqlite = SettingsStore.isSqlite;
Alert.alert(
localeString('views.Tools.migration.export.title'),
const setStatus = (msg: string | null) =>
this.setState({
isChannelExporting: msg !== null,
channelExportMessage: msg ?? ''
});
const warningText =
`${localeString('views.Tools.migration.export.text1')}\n\n` +
`⚠️ ${localeString('views.Tools.migration.export.text2')}`,
[
{
text: localeString('general.cancel'),
style: 'cancel'
},
{
text: localeString('views.Tools.migration.export.olympus'),
style: 'default',
onPress: async () => {
await uploadChannelBackupToOlympus(
lndDir(),
isTestnet,
pubkey,
seedPhrase,
(msg) =>
this.setState({
isChannelExporting: msg !== null,
channelExportMessage: msg ?? ''
})
);
`⚠️ ${localeString('views.Tools.migration.export.text2')}`;
if (isSqlite) {
Alert.alert(
localeString('views.Tools.migration.export.title'),
warningText,
[
{
text: localeString('general.cancel'),
style: 'cancel'
},
{
text: localeString(
'views.Tools.migration.export.olympus'
),
style: 'default',
onPress: async () => {
await uploadChannelBackupToOlympus(
lndDir(),
isTestnet,
pubkey,
seedPhrase,
setStatus
);
}
},
{
text: localeString(
'views.Tools.migration.export.local'
),
style: 'default',
onPress: async () => {
await exportChannelDb(
lndDir(),
isTestnet,
setStatus
);
}
}
},
{
text: localeString('views.Tools.migration.export.local'),
style: 'default',
onPress: async () => {
await exportChannelDb(lndDir(), isTestnet, (msg) =>
this.setState({
isChannelExporting: msg !== null,
channelExportMessage: msg ?? ''
})
);
]
);
} else {
Alert.alert(
localeString('views.Tools.migration.export.title'),
warningText,
[
{
text: localeString('general.cancel'),
style: 'cancel'
},
{
text: localeString('general.ok'),
style: 'default',
onPress: async () => {
await exportChannelDb(
lndDir(),
isTestnet,
setStatus
);
}
}
}
]
);
]
);
}
};
render() {