Skip to content

Commit 9ffe6bd

Browse files
authored
fix: app crashes when connection github on external projects [IN-885] (#3695)
1 parent ec088b6 commit 9ffe6bd

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

frontend/src/config/integrations/github-nango/components/settings/github-settings-drawer.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,19 @@ const isDrawerVisible = computed({
138138
});
139139
140140
const fetchSubProjects = () => {
141-
LfService.findSegment(props.grandparentId).then((segment) => {
142-
subprojects.value = segment.projects.map((p) => p.subprojects).flat().filter((s) => s !== undefined);
143-
});
141+
// OSS projects have thousands of subprojects which crash the app
142+
const EXTERNAL_OSS_SEGMENT_ID = '0fc01c53-8a6a-47db-b0cd-53de0ee65190';
143+
144+
if (props.grandparentId === EXTERNAL_OSS_SEGMENT_ID && props.segmentId) {
145+
// Only fetch current subproject, avoiding thousands of others
146+
LfService.findSegment(props.segmentId).then((currentSubproject) => {
147+
subprojects.value = [currentSubproject];
148+
});
149+
} else {
150+
LfService.findSegment(props.grandparentId).then((segment) => {
151+
subprojects.value = segment.projects.map((p) => p.subprojects).flat().filter((s) => s !== undefined);
152+
});
153+
}
144154
};
145155
146156
const $v = useVuelidate();

0 commit comments

Comments
 (0)