Skip to content

Commit be75357

Browse files
committed
fix: default redirect display when no default set
1 parent 98cee8e commit be75357

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/views/RedirectsView.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ getRedirects().then((response) => {
1717
});
1818
1919
const defaultEndpoint = (redirect: Redirect) => {
20+
if (redirect.endpoints.length === 0) {
21+
return "";
22+
}
2023
const defaultEndpoint = redirect.endpoints.find(
2124
(endpoint) => endpoint.is_default
2225
)?.endpoint;
2326
if (!defaultEndpoint) {
24-
return null;
27+
// just grab the first endpoint if there is no default
28+
return removeProtocol(redirect.endpoints[0].endpoint);
2529
}
2630
return removeProtocol(defaultEndpoint);
2731
};

0 commit comments

Comments
 (0)