Skip to content

Commit

Permalink
fix: fix statement not saving (#4872)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Sep 13, 2024
1 parent 4ac77eb commit 789ae2e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/composables/useClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export function useClient() {
return client.statement(auth.web3, web3.value.account, {
space: space.id,
about: payload.about,
statement: payload.statement
statement: payload.statement,
discourse: payload.discourse,
network: payload.network,
status: payload.status
});
} else if (type === 'flag-proposal') {
return client.flagProposal(auth.web3, web3.value.account, {
Expand Down
19 changes: 17 additions & 2 deletions src/composables/useStatement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export function useStatement() {
statement: {
about: string;
statement: string;
discourse: string;
network: string;
status: string;
}
) {
const result = await send({ id: spaceId }, SET_STATEMENT_ACTION, statement);
Expand Down Expand Up @@ -78,8 +81,20 @@ export function useStatement() {
await loadStatements(spaceId, [id]);
}

function getStatement(id: string): { about: string; statement: string } {
const defaultStatement = { about: '', statement: '' };
function getStatement(id: string): {
about: string;
statement: string;
network: string;
status: string;
discourse: string;
} {
const defaultStatement = {
about: '',
statement: '',
network: '',
status: 's',
discourse: ''
};
return clone(statements.value?.[id?.toLowerCase()] || defaultStatement);
}

Expand Down
3 changes: 3 additions & 0 deletions src/helpers/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ export const STATEMENTS_QUERY = gql`
about
ipfs
id
discourse
network
status
}
}
`;
Expand Down
5 changes: 4 additions & 1 deletion src/views/SpaceDelegate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { DelegationTypes } from '@/helpers/delegationV2';
const INITIAL_STATEMENT = {
about: '',
statement: ''
statement: '',
discourse: '',
network: 'INACTIVE',
status: 's'
};
const props = defineProps<{
Expand Down

0 comments on commit 789ae2e

Please sign in to comment.