Skip to content

Commit

Permalink
feat(in-app): compatible with fields format used by Unity SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyeh authored and sdjdd committed Nov 17, 2023
1 parent bf4a361 commit ddac70a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion in-app/v1/src/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,28 @@ export default function App() {

const params = useHashConfiguration();

const queries = useMemo(
() =>
decodeQueryParams(
{
fields: StringParam,
},
parse(window.location.search)
),
[]
);

useEffect(() => {
let fields;
try {
// double decode because of double encode
// https://git.gametaptap.com/tds/client-sdk/tds-sdk-all/tapsdk2/tapsdk2-unity/-/commit/f3dcce46f296e6e96da90f47c3bcb613a9f1b193#cd51e796096a3fe2f7189047d5073c1778c795a6_142_142
fields = params['fields'] ?? JSON.parse(decodeURIComponent(queries['fields'] ?? ''));
} catch (error) {}

setTicketInfo({
meta: params.meta,
fields: params.fields,
fields,
});
}, []);

Expand Down

0 comments on commit ddac70a

Please sign in to comment.